Last active
August 2, 2020 18:44
-
-
Save apple502j/43b2bb095745c5bc1ac3038354724977 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Don't Load Project | |
// @description Do not load project when reading comments | |
// @author apple502j | |
// @match https://scratch.mit.edu/projects/* | |
// ==/UserScript== | |
// Credit to Florrie | |
const destroyGUI = () => { | |
const oldMap = Array.prototype.map; | |
Array.prototype.map = function(...args) { | |
// loader.jsx | |
if (this && this[0] && this[0].weight) { | |
Array.prototype.map = oldMap; | |
throw new Error('loader crashed; you are reading a comment'); | |
} | |
return oldMap.apply(this, args); | |
}; | |
}; | |
if (location.hash.startsWith('#comments-')) { | |
console.log('we will destroy gui') | |
destroyGUI(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment