CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.
CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.
Path: blob/master/PHEx/src/disableIntegrity.js
Views: 720
/**1* disableIntegrity.js2*3* Currently maintained by ProdigyPNP4* Original author: Prodigy-Hacking5* Contributors: hostedposted, gemsvido, Eris6* File has been updated for Manifest V37*/8910(async () => {1112const browser = chrome || browser;1314/** get an item from chrome local storage */15function get(key) {16return new Promise(resolve => {17browser.storage.local.get([key], result => {18resolve(result[key]);19});20});21}2223/** Custom P-NP URL */24const url = await get("url");2526/** Use Custom P-NP URL */27const checked = await get("checked");2829/** RedirectorDomain */30const PNPURL = (url && checked) ? url : await (await fetch("https://infinitezero.net/domain")).text();3132333435/*-----------------------------------------------*36* *37* INJECT GAME.MIN.JS *38* *39------------------------------------------------*/4041async function insertCode () {42try {43/** P-NP Loader. If you're using a custom URL, then you have the ?force attribute. */44const request = await (await fetch(`https://infinitezero.net/eval${(url && checked) ? "?force=" + url : ""}`)).text();45document.documentElement.setAttribute("onreset", `${request}\nSW.Load.decrementLoadSemaphore();`);46document.documentElement.dispatchEvent(new CustomEvent("reset"));47document.documentElement.removeAttribute("onreset");48} catch (e) {49alert("Failed to load the hacks. Error:\n" + e.message);50}51}525354555657/*-----------------------------------------------*58* *59* DISABLE INTEGRITY *60* *61------------------------------------------------*/626364if (!window.scriptIsInjected) {65window.scriptIsInjected = true;66setTimeout(insertCode, 1000);67console.group("integrity patches");68[...document.getElementsByTagName("script"), ...document.getElementsByTagName("link")].forEach(v => {69if (v.integrity) {70console.log(v.integrity);71v.removeAttribute("integrity");72}73});74console.groupEnd();75}76777879808182/*-----------------------------------------------*83* *84* LATEST PHEx VERSION *85* *86------------------------------------------------*/878889/** User's version of PHEx */90const pluginVersion = chrome.runtime.getManifest().version;9192/** Latest version of PHEx. */93const supportedVersion = (await (await fetch(`${PNPURL}/version`)).text());949596/** Checks for plugin version. If outdated, triggers dialog box */97if (pluginVersion !== supportedVersion) {98const res = confirm(`PHEx is outdated. If you experience any errors, please update.\n\Your Version: ${pluginVersion}\nLatest Version: ${supportedVersion}`);99if (res) { location = "https://github.com/ProdigyPNP/ProdigyMathGameHacking/blob/master/meta/wiki/UPDATING.md"; }100}101102103104105106107108/*-----------------------------------------------*109* *110* CUSTOM LOADING TEXT *111* *112------------------------------------------------*/113114/** Custom Loading Text Array */115const customLoadingText = await (await (await fetch("https://raw.githubusercontent.com/ProdigyPNP/P-NP/master/loadingText.txt")).text()).split("\n");116117/** Which text to use */118var index = 0;119120/** Update custom loading text index */121setInterval(() => {122index = Math.floor(Math.random() * customLoadingText.length);123}, 2000);124125126/** Override the loading text */127setInterval(() => {128const LT = document.getElementById("loading-text");129if (LT) LT.innerHTML = customLoadingText[index];130}, 100);131132133134135})();136137138