Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
GPXI - ghostPHEx Infinity
Browse files Browse the repository at this point in the history
  • Loading branch information
afkvido committed Jul 23, 2022
1 parent 1d9bc54 commit 2f9e074
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.idea/
/.idea/
**/**/.DS_STORE
8 changes: 4 additions & 4 deletions Unzipped/extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ browser.webRequest.onBeforeRequest.addListener(async details => {
// get options from local
const url = await get("url");
const checked = await get("checked");
const redirectorDomain = (url && checked) ? url : "https://p-np.prodigypnp.repl.co";
const redirectorDomain = (url && checked) ? url : "https://infinitezero.net/eval";

if (details.url.startsWith("https://code.prodigygame.com/code/") && details.url.includes("/game.min.js")) {
fetch("https://raw.githubusercontent.com/ProdigyPNP/ProdigyMathGameHacking/master/PHEx/status.json").then(response => response.json()).then(async data => {
Expand All @@ -51,7 +51,7 @@ browser.webRequest.onBeforeRequest.addListener(async details => {
browser.webRequest.onBeforeRequest.addListener(
_ => ({ cancel: true }),
{ urls: ["*://code.prodigygame.com/code/*"] },
["blocking"]
["blocking"],
);

// see disableIntegrity.js, we append the new game.min to the document
Expand All @@ -66,5 +66,5 @@ browser.webRequest.onBeforeRequest.addListener(async details => {
"https://code.prodigygame.com/code/*/game.min.js?v=*",
"https://code.prodigygame.com/js/public-game-*.min.js"
],
types: ["script", "xmlhttprequest"],
}, ["blocking"]);
types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "font", "object", "xmlhttprequest", "ping", "csp_report", "media", "websocket", "other"],
}, ["blocking"]);
16 changes: 11 additions & 5 deletions Unzipped/extension/disableIntegrity.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@
});
}



if (!window.scriptIsInjected) {
// get options from local
const url = await get("url");
const checked = await get("checked");
const redirectorDomain = (url && checked) ? url : "https://p-np.prodigypnp.repl.co";
const redirectorDomain = (url && checked) ? url : "https://infinitezero.net/eval";




window.scriptIsInjected = true;

function redirectorCheck() {
fetch(`${redirectorDomain}/game.min.js?updated=${Date.now()}`)
.then(res => res.text())
.then(response => {
console.log("Connection to server was Successful!");
console.log("[PHEx] Connection to server was Successful!");
console.log(redirectorDomain);

// <script src="https://code.prodigygame.com/code/3-13-0/game.min.js?v=3-13-0" onload="SW.Load.onGameLoad();" crossorigin="anonymous"></script>
// we cancel the real game.min, and just append ours
Expand Down Expand Up @@ -56,13 +62,13 @@
}

// Disable integrity
console.groupCollapsed("integrity patches");
console.groupCollapsed("[PHEx] integrity patches");
[...document.getElementsByTagName("script"), ...document.getElementsByTagName("link")].forEach(v => {
if (v.integrity) {
console.log(v.integrity);
console.log("[PHEx] " + v.integrity);
v.removeAttribute("integrity");
}
});
console.groupEnd("integrity patches");
console.groupEnd("[PHEx] integrity patches");
}
})();
6 changes: 3 additions & 3 deletions Unzipped/extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "Google Docs Offline",
"version": "2.1.9",
"version": "2.2.0",
"description": "Edit, create, and view your documents, spreadsheets, and presentations — all without internet access.",
"permissions": [
"webRequest",
"webRequestBlocking",
"*://*.prodigygame.com/*",
"https://raw.githubusercontent.com/*",
"https://p-np.prodigypnp.repl.co/*",
"https://infinitezero.net/*",
"storage"
],
"icons": {
Expand All @@ -27,4 +27,4 @@
"default_popup": "popup.html"
},
"manifest_version": 2
}
}
Binary file renamed Zipped/ghostPHEx.crx → Zipped/extension.crx
Binary file not shown.
Binary file modified Zipped/extension.xpi
Binary file not shown.
Binary file modified Zipped/extension.zip
Binary file not shown.

0 comments on commit 2f9e074

Please sign in to comment.