Last active
September 3, 2021 05:15
-
-
Save nomomon/cb27f521ea45c352bb74eae0780f00d4 to your computer and use it in GitHub Desktop.
Bookmarklet to get answers to Khan Academy math problems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(ns, fetch){ | |
if(typeof fetch !== 'function') return; | |
console.log("🌱%c Khan Academy%c Hack is%c ON %c \nBy: https://github.com/nomomon", "text-shadow: 0.5px 0.5px 0 black, -0.5px -0.5px 0 black; color: white;", "color:black;", "color:green;", "color:black;"); | |
ns.fetch = function(){ | |
var out = fetch.apply(this, arguments); | |
out.then(res =>{ | |
if(res.url.indexOf("getAssessmentItem")+1){ | |
res.clone().json().then(data => { | |
console.log(JSON.parse(data.data.assessmentItem.item.itemData).question) | |
}) | |
} | |
}); | |
return out; | |
} | |
}(window, window.fetch)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment