Skip to content

Instantly share code, notes, and snippets.

View nahjittrippinfr's full-sized avatar

nahjittrippinfr

View GitHub Profile
@Apearson75
Apearson75 / mini.js
Last active April 30, 2024 19:21
Mathswatch Answer Viewer
javascript:function getCookie(e){const t=`; ${document.cookie}`.split(`; ${e}=`);if(2===t.length)return t.pop().split(";").shift()}async function getRequest(e,t){const s=await fetch(e,{headers:{accept:"*/*","accept-language":"en-GB,en-US;q=0.9,en;q=0.8","cache-control":"no-cache",pragma:"no-cache","sec-ch-ua":'"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-csrf-token":getCookie("_csrf")},referrer:t,referrerPolicy:"strict-origin-when-cross-origin",body:null,method:"GET",mode:"cors",credentials:"include"});return await s.json()}async function getAnswers(){const e=document.querySelector("#studentmodal > div > div:nth-child(4) > div > div.questioncolumn > div > div.progressblock > div > div.col-sm-10.col-xs-8 > div > div:nth-child(1) > progressbar"),t=currentPage.split("/");let s="Answers Are:";if(100==parseInt(e.getAttribute("value"))&&7==t.length&&"assign