Skip to content

Commit

Permalink
2.1: prevent double-init crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrapivin committed Mar 21, 2022
1 parent 4df3bd4 commit a6fb8e9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 14 deletions.
17 changes: 9 additions & 8 deletions extrouselle/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Røuselle",
"description": "Allows you to run games made with the Opera GX export and use GXC in any browser.",
"author": "nkrapivindev",
"version": "2.0",
"version": "2.1",
"icons": {
"192": "nik_pets_icon192.png",
"128": "nik_pets_icon128.png",
Expand All @@ -14,15 +14,16 @@
"content_scripts": [
{
"matches": [
"*://*.gxc.gg:*/*",
"*://*.gmx.dev:*/*",
"*://*.localhost:*/*",
"*://*.itch.io:*/*",
"*://*.gamejolt.com:*/*",
"*://*.hwcdn.net:*/*"
"*://*.gxc.gg:*/*",
"*://*.gmx.dev:*/*",
"*://*.localhost:*/*",
"*://*.itch.io:*/*",
"*://*.gamejolt.com:*/*",
"*://*.newgrounds.com:*/*",
"*://*.ungrounded.net:*/*"
],
"all_frames": true,
"run_at": "document_start",
"run_at": "document_start",
"js": [
"nik_pets.js"
]
Expand Down
16 changes: 14 additions & 2 deletions extrouselle/nik_pets.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
// nik_pets.js
/****
* == Rouselle (Content Script) ==
* v2.0
* v2.1
*
* Last Modified: 14 Feb 2022 (10:06 UTC+5)
* Last Modified: 21 Mar 2022 (06:10 UTC+5)
*
* @author Nikita Krapivin <hi.russell@example.com>
*/

"use strict";

(function() { // -- wrap in a function to allow to cancel init (see if below) -- //

if (typeof(nik_pets_Init) !== "undefined") {
console.log("nik_pets.js: Already initialised.");
return false;
}

/**
* Initializes the extension.
*/
Expand Down Expand Up @@ -67,3 +74,8 @@ function nik_pets_Init() {

// -- The entrypoint is here -- //
nik_pets_Init();
return true;

})();


15 changes: 13 additions & 2 deletions extrouselle/nik_pets_fucktimebomb.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
// nik_pets_fucktimebomb.js
/****
* == Rouselle (Timebomb Patcher) ==
* v2.0
* v2.1
*
* Last Modified: 14 Feb 2022 (10:06 UTC+5)
* Last Modified: 21 Mar 2022 (06:10 UTC+5)
*
* @author Nikita Krapivin <hi.russell@example.com>
*/

"use strict";

(function() { // -- wrap in a function to allow to cancel init (see if below) -- //

// -- very cursed code below -- //

if (typeof(nik_pets_TimeBombPatcherInit) !== "undefined") {
console.log("nik_pets_fucktimebomb.js: Already initialised.");
return false;
}

let nik_pets_XhrOpenOrig = XMLHttpRequest.prototype.open;
let nik_pets_FS_Orig = undefined;

Expand Down Expand Up @@ -234,3 +241,7 @@ function nik_pets_TimeBombPatcherInit() {

// -- the entry point is here -- //
nik_pets_TimeBombPatcherInit();
return true;

})();

15 changes: 13 additions & 2 deletions extrouselle/nik_pets_stage2.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
// nik_pets_stage2.js
/****
* == Rouselle (Stage 2) ==
* v2.0
* v2.1
*
* Last Modified: 14 Feb 2022 (10:06 UTC+5)
* Last Modified: 21 Mar 2022 (06:10 UTC+5)
*
* @author Nikita Krapivin <hi.russell@example.com>
*/

"use strict";

(function() { // -- wrap in a function to allow to cancel init (see if below) -- //

if (typeof(nik_pets_Stage2Init) !== "undefined") {
console.log("nik_pets_stage2.js: Already initialised.");
return false;
}

// -- only used for old auth flow LOL -- //
const nik_pets_REPLY = { hash: [ 185, 66, 169, 195, 1, 196, 6, 209, 109, 32, 69, 100, 5, 236, 130, 37, 162, 86, 183, 235 ] };
const nik_pets_REPLY_PRODUCT = { product: "Opera GX" };
Expand Down Expand Up @@ -230,3 +237,7 @@ function nik_pets_Stage2Init() {

// -- the entry point is here -- //
nik_pets_Stage2Init();
return true;

})();

0 comments on commit a6fb8e9

Please sign in to comment.