Skip to content

Commit

Permalink
additional js core object properties spoofed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalvinci committed Apr 14, 2022
1 parent 9be3604 commit f3ce6e5
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 4 deletions.
51 changes: 51 additions & 0 deletions js/injectedScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
});
Expand All @@ -26,10 +30,57 @@ 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,
});

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=",
});
2 changes: 1 addition & 1 deletion js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@1,300&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap.rtl.min.css" />
<link rel="stylesheet" href="libs/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="libs/bootstrap/bootstrap.rtl.min.css" />
<link rel="stylesheet" href="css/popup.css" />
</head>
<body>
Expand Down Expand Up @@ -39,7 +39,7 @@
<div id="overlay"></div>
<div class="spinner-border text-danger position-absolute"></div>
</div>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="libs/bootstrap/bootstrap.bundle.min.js"></script>
<script src="js/popup.js"></script>
</body>
</html>

0 comments on commit f3ce6e5

Please sign in to comment.