A tiny Chrome extension (plain HTML / CSS / JavaScript, Manifest V3) that opens the Codeforces problem you're viewing in the CP Ally desktop app.
Press Ctrl + B on any Codeforces problem page and the
extension launches cpally://problem/<code> — e.g. cpally://problem/4A.
- Codeforces-only. The content script and host permissions are scoped to
codeforces.com, so the extension has no access to any other site. - One shortcut. Ctrl + B on a problem page opens it in CP Ally and shows a small confirmation toast.
- In-page button. A white Open in CP Ally IDE button (with the logo) is added to the contest-details panel in the right sidebar and does the same thing.
- Toolbar popup. Click the icon (next to the URL bar) for a small GUI: the
detected problem code, an Open in CP Ally IDE button, quick links to the
problem's Statement / Submit / My submissions / Standings pages, and
copy-to-clipboard helpers for the code and the
cpally://link. Dark theme with a neon-green accent. - No build step, no dependencies. Just static files you load unpacked.
- A content script runs only on
codeforces.compages. - When you press Ctrl + B, it reads the current URL and
extracts the problem code (contest id + index, e.g.
4+A→4A). - It opens
cpally://problem/<code>via a hidden iframe, which hands the link to whichever app is registered for thecpally://protocol on your system.
Note: the extension only triggers the
cpally://link. Something on your machine has to be registered to handle that protocol (the CP Ally app). If nothing is registered, the browser will say it can't open the link — see Testing for how to register a temporary handler.
| Page type | Example URL | Code |
|---|---|---|
| Contest | https://codeforces.com/contest/4/problem/A |
4A |
| Problemset | https://codeforces.com/problemset/problem/4/A |
4A |
| Gym | https://codeforces.com/gym/102222/problem/C |
102222C |
| Group | https://codeforces.com/group/abcDEF12/contest/4/problem/A |
4A |
Problem indices with a sub-number (e.g. A1, F2) are supported too. On any
other Codeforces page the shortcut does nothing.
cp-ally-extension/
├── manifest.json # Manifest V3 config, permissions, icons
├── cf.js # Shared logic: URL parsing + cpally:// launch (used by both below)
├── content.js # Runs on codeforces.com; listens for Ctrl+B; shows the toast
├── popup.html # Toolbar popup markup
├── popup.css # Popup styles
├── popup.js # Popup logic: detect code in the active tab, Open button
├── logo.png # Extension icon
├── .gitignore
├── LICENSE
└── README.md
- Open
chrome://extensionsin Chrome (or any Chromium browser — Edge, Brave…). - Toggle Developer mode on (top-right).
- Click Load unpacked and select this project folder.
- The CP Ally icon appears in the toolbar. Pin it for quick access.
After editing any file, return to chrome://extensions and click the reload
(↻) icon on the extension card.
- Open a Codeforces problem, e.g. https://codeforces.com/contest/4/problem/A.
- Press Ctrl + B → CP Ally opens
cpally://problem/4A. - Or click Open in CP Ally IDE in the contest panel on the right.
- Or click the toolbar icon and use the popup (Open button, quick links, copy).
See the Testing section below in the repo notes, or the instructions shared when this was set up. In short:
- Load the extension unpacked (above).
- Visit a problem page and open DevTools → Console. Pressing
Ctrl + B logs
[CP Ally] launching cpally://problem/4A, which confirms detection works even without the protocol handler installed. - The popup shows the detected code, which is the quickest way to verify parsing on different problem URLs.
- To verify the actual launch, register a handler for
cpally://(a real CP Ally install, or a temporary test handler) and watch it open.
host_permissions: *://codeforces.com/*(and subdomains) — lets the content script run on, and the popup read the URL of, Codeforces tabs only.
No tabs, no <all_urls>, no background access to other sites.
See LICENSE.