added handle Cses submit and cses injected script to submit the cses… - #39
Conversation
| { | ||
| "manifest_version": 3, | ||
| "permissions": ["scripting", "webNavigation", "offscreen"], | ||
| "permissions": ["scripting", "webNavigation", "offscreen","tabs"], |
There was a problem hiding this comment.
Why does it need this new permission?
There was a problem hiding this comment.
Fixed it, That was my bad. I thought it was needed for tab operations.
|
Thanks. Can you verify it works on both Firefox and Chrome? Also update the readme. |
…for chrome aswell
2026-06-06.19-03-50.mp42026-06-06.19-06-31.mp4 |
| "license": "MIT", | ||
| "devDependencies": { | ||
| "copy-webpack-plugin": "^14.0.0", | ||
| "merge-jsons-webpack-plugin": "^2.0.1", |
There was a problem hiding this comment.
Why is this added? Undo all changes in package.json and package-lock.json
|
@sachin-prmndani please ensure the pipelines pass. |
|
|
||
| Browser add on that enables Codeforces submit with | ||
| [Competitive Programming Helper](https://github.com/agrawal-d/cph) | ||
| Browser add on that enables direct submit on platforms like codeforces and CSES with [Competitive Programming Helper](https://github.com/agrawal-d/cph) |
There was a problem hiding this comment.
Capitalization missing. Also break the long line.
|
|
||
| const form = document.querySelector('form'); | ||
| if (!form) { | ||
| log('CSES form not found'); |
|
@agrawal-d |
|
Thanks for the contribution! Looks good. |
Title :Added automated submission support for CSES
[https://github.com/agrawal-d/cph/pull/676](THE FEATURE)
Workflow & Implementation:
This PR manages the "Execution" phase of the pipeline:
Targeting: A new detection logic, isCSESProblem, identifies when a submission request is for cses.fi.
Context Injection: Upon navigation to the CSES submit page, the background script injects csesInjectedScript.ts.
Pseudo-File Creation: Since browser extensions are restricted from accessing local files directly for security reasons, the script uses the DataTransfer API to create a virtual File object in-memory from the provided source code.
DOM Manipulation: The script programmatically attaches this virtual file to the CSES file input, selects the appropriate language from the dropdown, and dispatches native browser events to ensure the form registers the changes.
Submission: The script triggers the form submission, completing the end-to-end automation.
Proof Of Work : please watch the video
2026-06-04.22-18-47.mp4