Skip to content

About

Browser extension that automatically detects and fills Codeforces problem IDs in the submission form

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

CF Auto Submit

A lightweight browser extension for Codeforces that automatically fills the problem ID on the submit page. Built with Manifest V3, vanilla JavaScript, and no frameworks.

Features

  • Auto-detect problem ID from contest, problemset, gym, and group contest URLs
  • Auto-fill submittedProblemCode (problemset) and submittedProblemIndex (contest/gym) without overwriting your input
  • MutationObserver for dynamically loaded submit forms
  • Keyboard shortcut Alt + S — open submit page and fill the problem
  • Language memory — remembers your last programTypeId selection
  • Minimal indicator — small “Problem detected: 2100C” badge when a problem is recognized
  • Chrome & Firefox — single codebase, MV3-compatible

Supported URLs

Page type Example URL Problem code
Contest /contest/2100/problem/C 2100C
Problemset /problemset/problem/2100/C 2100C
Gym /gym/123456/problem/A 123456A
Group contest /group/.../contest/2100/problem/B 2100B

Submit pages are detected automatically (/contest/*/submit, /problemset/submit, /gym/*/submit, etc.).

Installation

Chrome (developer / unpacked)

  1. Clone or download this repository.
  2. Generate icons if needed: python3 scripts/generate-icons.py
  3. Open chrome://extensions
  4. Enable Developer mode
  5. Click Load unpacked and select the project folder (cf-autosubmit)

Firefox (temporary)

  1. Open about:debugging#/runtime/this-firefox
  2. Click Load Temporary Add-on…
  3. Select manifest.json in this folder

For a signed Firefox release, package with web-ext (see Build & packaging).

Keyboard shortcut

After install, confirm the shortcut at:

  • Chrome: chrome://extensions/shortcuts
  • Firefox: about:addons → CF Auto Submit → gear → Manage Extension Shortcuts

Default: Alt + S

Usage

  1. Open any supported Codeforces problem page.
  2. A small indicator appears: Problem detected: 2100C.
  3. Go to the submit page (menu or Alt + S).
  4. The problem field is filled only if it was empty; your edits are never overwritten.
  5. Your last programming language is preselected on the next submit.

Click the extension icon for a quick status popup.

Project structure

cf-autosubmit/
├── manifest.json       # MV3 manifest (Chrome + Firefox)
├── content.js          # Page detection, form fill, indicator, observer
├── background.js       # Alt+S command, navigation, fill retries
├── popup/
│   ├── popup.html
│   ├── popup.css
│   └── popup.js
├── icons/
│   ├── icon16.png
│   ├── icon48.png
│   └── icon128.png
├── scripts/
│   ├── build.sh
│   └── generate-icons.py
├── store/              # Chrome Web Store listing metadata
└── README.md

Build & packaging

Generate icons

python3 scripts/generate-icons.py

Create distributable ZIP

./scripts/build.sh

Output: dist/cf-autosubmit-v1.0.0.zip

Firefox (signed / AMO)

npm install -g web-ext
web-ext lint
web-ext build --source-dir . --artifacts-dir dist

Upload the artifact from web-ext build to addons.mozilla.org.

Chrome Web Store

  1. Zip the extension (use scripts/build.sh or zip manually without dist/, .git, scripts/ if desired).
  2. Upload at Chrome Developer Dashboard.
  3. Use copy from store/chrome-listing.md.

Permissions

Permission Why
storage Sync last problem & language for popup and Alt+S
host_permissions → codeforces.com Navigate to submit page on shortcut

No access to other sites, no remote code, no analytics.

Icon suggestions

Current icons: blue badge with CF (Codeforces-style blue #1f6feb).

Ideas for a future refresh:

  • Stylized “>>” submit arrow merged with problem letter C
  • Monochrome glyph for better contrast in dark browser themes
  • Optional dark-mode variant via theme_icons in manifest

Regenerate anytime with scripts/generate-icons.py or replace PNGs in icons/.

Future improvements

  • Options page to disable indicator or customize shortcut
  • Support *.contest.codeforces.com group mirrors
  • Retry fill when contest problem dropdown loads late (right after contest start)
  • Optional “fill even if field has value” toggle for power users
  • Export/import settings across browsers via chrome.storage.sync
  • Integration with local IDE submit tools via externally_connectable (opt-in)

Security & privacy

  • Local only: Problem IDs and language preference are stored in your browser (localStorage on codeforces.com and chrome.storage.local). Nothing is sent to third-party servers.
  • No credentials: The extension does not read passwords, cookies for exfiltration, or submission source code.
  • Minimal scope: Runs only on codeforces.com content scripts plus storage.
  • No overwrite: Deliberately avoids changing fields you already filled, reducing accidental wrong submits.
  • Open source: Audit content.js and background.js — total script size is small.

Disclaimer: Always verify the problem ID before submitting. This tool assists filling forms; you are responsible for correct submissions.

Development

Reload the extension after edits:

  • Chrome: chrome://extensions → Reload
  • Firefox: about:debugging → Reload

Test paths:

  1. Visit https://codeforces.com/problemset/problem/2100/C
  2. Press Alt + S or open submit manually
  3. Confirm submittedProblemCode shows 2100C when empty

About

Browser extension that automatically detects and fills Codeforces problem IDs in the submission form

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages