cp.nvim/scrapers
Barrett Ruth a202725cc5
fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305)
## Problem

After the initial submit hardening, two issues remained: source code was
read in Lua and piped as stdin to the scraper (unnecessary roundtrip
since
the file exists on disk), and CF's `page.fill()` timed out on the hidden
`textarea[name="source"]` because CodeMirror owns the editor state.

## Solution

Pass the source file path as a CLI arg instead — AtCoder calls
`page.set_input_files(file_path)` directly, CF reads it with
`Path(file_path).read_text()`. Fix CF source injection via
`page.evaluate()`
into the CodeMirror instance. Extract `BROWSER_SUBMIT_NAV_TIMEOUT` as a
per-platform `defaultdict` (CF defaults to 2× nav timeout). Save the
buffer
with `vim.cmd.update()` before submitting.
2026-03-05 14:34:14 -05:00
..
__init__.py lol 2025-09-24 21:23:06 -04:00
atcoder.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
base.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
codechef.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
codeforces.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
cses.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
kattis.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
language_ids.py feat(atcoder): extract submit helpers; add live status notifications (#294) 2026-03-04 19:27:29 -05:00
models.py feat(scraper): add precision extraction, start_time, and submit support 2026-03-03 15:09:41 -05:00
timeouts.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
usaco.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00