Open T3M1N4L opened 1 month ago
Looks like khan academy may have patched it, as I converted the bookmarklet into a console command and ran it, and Khan Academy just reloaded.
This is what I used -
if (typeof originalParse === "undefined") {
window.originalParse = JSON.parse;
}
JSON.parse = function (t, e) {
let n = originalParse(t, e);
try {
const itemData = JSON.parse(n.data.assessmentItem.item.itemData);
const isPT = location.hostname.split(".")[0] === "pt";
if (itemData.question && itemData.question.content &&
itemData.question.content[1] === itemData.question.content[1].toUpperCase()) {
console.log(itemData);
itemData.question.content += "\n [[☃ explanation 3]] [[☃ explanation 4]]";
itemData.question.widgets["explanation 3"] = {
alignment: "default",
graded: true,
options: {
explanation: itemData.hints[itemData.hints.length - 1].content,
hidePrompt: isPT ? "Ocultar" : "Hide",
showPrompt: isPT ? "Resposta" : "Answer",
static: false,
widgets: itemData.hints[itemData.hints.length - 1]
}
};
itemData.question.widgets["explanation 4"] = {
options: {
explanation: "discord.gg/khanacademy",
hidePrompt: "",
showPrompt: "Discord"
}
};
n.data.assessmentItem.item.itemData = JSON.stringify(itemData);
}
} catch (error) {
console.error("Error parsing lesson data:", error);
}
return n;
};
location.softReload = () => {
const htmlContent = document.getElementsByTagName("html")[0].outerHTML;
document.open();
document.write(htmlContent);
document.close();
};
location.softReload();
console.error = function () {};
I found the userscript i was using, I was using @doxrgithub 's
// ==UserScript==
// @name Khan answer revealer
// @version 1.0
// @description Khan hack
// @author IlyTobias (github@ilytobias)
// @match https://www.khanacademy.org/*
// @grant none
// ==/UserScript==
let n = JSON.parse;
JSON.parse = function (t) {
let e = n(t);
try {
let t = JSON.parse(e.data.assessmentItem.item.itemData);
t.question.content = t.question.content + "[[☃ explanation 2]]";
console.log(t);
t.question.widgets["explanation 2"] = {
alignment: "default"
, graded: true
, options: {
explanation: t.hints[t.hints.length - 1].content
, hidePrompt: "Hide"
, showPrompt: "Answer"
, static: false
, widgets: t.hints[t.hints.length - 1].widgets
}
, static: false
, type: "explanation"
, version: {
major: 0
, minor: 0
}
};
e.data.assessmentItem.item.itemData = JSON.stringify(t)
} catch (t) {}
return e
}
This returns a crash screen now
On math it returns a full white crash [uh-oh] screen
Upup!! He's right.
Describe the bug
Khan Academy gives a crash message when the user script is on, I then tried to update the user script to the latest version but tamper monkey simply says it's not a valid user script. I see you updated the bookmarklet a few hours ago, but I am on the arc browser, rendering bookmarklets useless. Please update the userscript
Steps to reproduce
Are you stupid
yeah probably
Operating System
Windows
Browser
Arc Browser
Before submitting a bug report
[X] This bug wasn't already reported (I have searched bug reports on GitHub).
[X] This is a valid bug (I am able to reproduce this on the latest build).