TheLazySquid / QuizletLiveCheat

Automatically answer questions in a game of Quizlet live
1 stars 0 forks source link

No longer working #1

Closed beforeblazergithub closed 10 months ago

beforeblazergithub commented 10 months ago

Just tested the tampermonkey script and go the error: userscript.html?name=Quizlet-Live-Cheat.user.js&id=09d94318-6a0e-42f2-bf07-5aaea7515b20:29 Uncaught (in promise) TypeError: Cannot read properties of null (reading '0') at userscript.html?name=Quizlet-Live-Cheat.user.js&id=09d94318-6a0e-42f2-bf07-5aaea7515b20:29:84 (anonymous) @ userscript.html?name=Quizlet-Live-Cheat.user.js&id=09d94318-6a0e-42f2-bf07-5aaea7515b20:29 Promise.then (async) addModifiedScript @ userscript.html?name=Quizlet-Live-Cheat.user.js&id=09d94318-6a0e-42f2-bf07-5aaea7515b20:25 (anonymous) @ userscript.html?name=Quizlet-Live-Cheat.user.js&id=09d94318-6a0e-42f2-bf07-5aaea7515b20:68 (anonymous) @ userscript.html?name=Quizlet-Live-Cheat.user.js&id=09d94318-6a0e-42f2-bf07-5aaea7515b20:44

Located in the addModifiedScript function: function addModifiedScript(src) { // we want to manually fetch the script so we can modify it fetch(src) .then(response => response.text()) .then(text => { const insertAfterRegex = /j=E()((0,i.Z)(.)),/g; const insertText = "window.qlc.setIo(j),"; // find the index of the insert after regex and append "window.qlc.io=j," after it const index = text.search(insertAfterRegex) + insertAfterRegex.exec(text)[0].length; text = text.slice(0, index) + insertText + text.slice(index); // create a new blob with the modified text const blob = new Blob([text], { type: 'text/javascript' }); const url = URL.createObjectURL(blob); // create a new script element with the modified url const script = document.createElement('script'); script.src = url; // append the script element to the document document.head.appendChild(script); }); }

Lemme know if you can get the script workign again ✌️

TheLazySquid commented 10 months ago

Hey! Thanks for providing the error log. This looks like Quizlet pushed an update that renamed some internal variables so the regex I was using to find where to insert some code no longer works. I've updated that so it hopefully will still work if Quizlet makes small scale changes in the future.