WHAT IS OUR PROJECT ?
Through this extension, we aim to remove this extra effort of checking the submission page to know the verdict of our submission. Using this extension we will automate the process of capturing the submission request and pinging the REST API of CodeChef responsible for giving the verdict repeatedly at some interval until the verdict is obtained. When the verdict is available, this extension will inform the user using desktop notifications so that the user can check the detailed status of their submission.
Project Stages
This project consists of following stages:
:

High level approach
- [ ] Make a submission on codechef and monitor the request made by the browser using the network tab in chrome developer tools.
- [ ] Identify the appropriate request and note down the URL to which the request is being sent and its request headers.
- [ ] In the background script, use the webRequest API of chrome to monitor the URL obtained in step 2 and save the submission id and x-csrf-token header value.
- [ ] In
manifest.json add the values to inject a content script in the submission page. Add code in the content script to fetch problem name and code from the web page and return these values upon request by background script.
- [ ] Again in the background script, upon detecting the submission request in webRequest API, send a message to the content script to obtain problem name and id and save them.
- [ ] Finally, repeatedly use XMLHttpRequest from the background script to the URL obtained in step 2 in some regular intervals until a verdict is obtained. Make sure to add x-csrf-header.
- [ ] When a verdict is obtained send a desktop notification to the user.
Things to learn :
- [ ] webRequestapi
- [ ] XHR RequestToooper
Links:
@https://www.crio.do/projects/javascript-codechef-notifier/