From f3ce6e551306e4acb6fad47902e735d538973890 Mon Sep 17 00:00:00 2001 From: Kalvinci Date: Thu, 14 Apr 2022 15:34:10 -0400 Subject: [PATCH] additional js core object properties spoofed --- js/injectedScript.js | 51 +++++++++++++++++++ js/popup.js | 2 +- .../bootstrap}/bootstrap.bundle.min.js | 0 .../bootstrap}/bootstrap.bundle.min.js.map | 0 {css => libs/bootstrap}/bootstrap.min.css | 0 {css => libs/bootstrap}/bootstrap.min.css.map | 0 {css => libs/bootstrap}/bootstrap.rtl.min.css | 0 .../bootstrap}/bootstrap.rtl.min.css.map | 0 popup.html | 6 +-- 9 files changed, 55 insertions(+), 4 deletions(-) rename {js => libs/bootstrap}/bootstrap.bundle.min.js (100%) rename {js => libs/bootstrap}/bootstrap.bundle.min.js.map (100%) rename {css => libs/bootstrap}/bootstrap.min.css (100%) rename {css => libs/bootstrap}/bootstrap.min.css.map (100%) rename {css => libs/bootstrap}/bootstrap.rtl.min.css (100%) rename {css => libs/bootstrap}/bootstrap.rtl.min.css.map (100%) diff --git a/js/injectedScript.js b/js/injectedScript.js index 81feb28..f6f4220 100644 --- a/js/injectedScript.js +++ b/js/injectedScript.js @@ -18,6 +18,10 @@ Object.defineProperty(navigator, "userAgent", { "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0", }); +Object.defineProperty(navigator, "userAgentData", { + get: () => undefined, +}); + Object.defineProperty(navigator, "languages", { get: () => ["en-US", "en"], }); @@ -26,6 +30,22 @@ Object.defineProperty(navigator, "deviceMemory", { get: () => undefined, }); +Object.defineProperty(navigator, "getBattery", { + get: () => () => undefined, +}); + +Object.defineProperty(navigator, "connection", { + get: () => undefined, +}); + +Object.defineProperty(navigator.keyboard, "getLayoutMap", { + get: () => () => undefined, +}); + +Object.defineProperty(navigator, "mediaDevices", { + get: () => undefined, +}); + Object.defineProperty(screen, "width", { get: () => 1498, }); @@ -33,3 +53,34 @@ Object.defineProperty(screen, "width", { Object.defineProperty(screen, "height", { get: () => 699, }); + +Object.defineProperty(screen, "availWidth", { + get: () => 1498, +}); + +Object.defineProperty(screen, "availHeight", { + get: () => 699, +}); + +Object.defineProperty(Date.prototype, "getTimezoneOffset", { + get: () => () => 0, +}); + +Object.defineProperty(Intl.DateTimeFormat.prototype, "resolvedOptions", { + get: () => () => { + return { + locale: "en-US", + calendar: "gregory", + numberingSystem: "latn", + timeZone: "UTC", + year: "numeric", + month: "numeric", + day: "numeric", + }; + }, +}); + +Object.defineProperty(HTMLCanvasElement.prototype, "toDataURL", { + get: () => () => + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAA8CAYAAABIFuztAAABjklEQVR4nO3VoQ3CAABFwXYSEN2ABIMiFSQgOkFNEThGwJEOwAwMwQRMQEDhCZIFWACF6W9y+sxzr+g3zfZTTo718/XeX6a7dnnqrvPVYVYtzrfH+s4555z/8mLoAM455+N0A+Gcc24gnHPODYRzznm4GwjnnHMD4ZxzbiCcc87D3UA455wbCOeccwPhnHMe7gbCOefcQDjnnBsI55zzcDcQzjnnBsI559xAOOech7uBcM45NxDOOecGwjnnPNwNhHPOuYFwzjk3EM455+FuIJxzzg2Ec865gXDOOQ93A+Gcc24gnHPODYRzznm4GwjnnHMD4ZxzbiCcc87D3UA455wbCOeccwPhnHMe7gbCOefcQDjnnBsI55zzcDcQzjnnBsI559xAOOech7uBcM45NxDOOecGwjnnPNwNhHPOuYFwzjk3EM455+FuIJxzzg2Ec865gXDOOQ93A+Gcc24gnHPODYRzznm4GwjnnHMD4ZxzbiCcc87D3UA455wbCOeccwPhnHMe7gbCOef8L/8Cl9z3SWtDbpIAAAAASUVORK5CYII=", +}); diff --git a/js/popup.js b/js/popup.js index 000ee4e..efdf690 100644 --- a/js/popup.js +++ b/js/popup.js @@ -177,7 +177,7 @@ window.onload = (event) => { async function reload(callback = null) { const tabId = await getCurrentTabId(); - chrome.tabs.reload(tabId); + chrome.tabs.reload(tabId, { bypassCache: true }); if (!callback) return; callback(); } diff --git a/js/bootstrap.bundle.min.js b/libs/bootstrap/bootstrap.bundle.min.js similarity index 100% rename from js/bootstrap.bundle.min.js rename to libs/bootstrap/bootstrap.bundle.min.js diff --git a/js/bootstrap.bundle.min.js.map b/libs/bootstrap/bootstrap.bundle.min.js.map similarity index 100% rename from js/bootstrap.bundle.min.js.map rename to libs/bootstrap/bootstrap.bundle.min.js.map diff --git a/css/bootstrap.min.css b/libs/bootstrap/bootstrap.min.css similarity index 100% rename from css/bootstrap.min.css rename to libs/bootstrap/bootstrap.min.css diff --git a/css/bootstrap.min.css.map b/libs/bootstrap/bootstrap.min.css.map similarity index 100% rename from css/bootstrap.min.css.map rename to libs/bootstrap/bootstrap.min.css.map diff --git a/css/bootstrap.rtl.min.css b/libs/bootstrap/bootstrap.rtl.min.css similarity index 100% rename from css/bootstrap.rtl.min.css rename to libs/bootstrap/bootstrap.rtl.min.css diff --git a/css/bootstrap.rtl.min.css.map b/libs/bootstrap/bootstrap.rtl.min.css.map similarity index 100% rename from css/bootstrap.rtl.min.css.map rename to libs/bootstrap/bootstrap.rtl.min.css.map diff --git a/popup.html b/popup.html index a91bdf7..0b0b3c3 100644 --- a/popup.html +++ b/popup.html @@ -7,8 +7,8 @@ href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@1,300&display=swap" rel="stylesheet" /> - - + + @@ -39,7 +39,7 @@
- +