Last active
June 4, 2024 10:23
-
-
Save SkyzohKey/1f8fe7c070cfe9e98f5dc9ec0c5caee2 to your computer and use it in GitHub Desktop.
Revisions
-
SkyzohKey revised this gist
Apr 25, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Spoof screen resolution & color depth // @namespace https://skyzohlabs.be // @version 1.0.5 // @description Spoof the reported window.screen as the most common one so that it can't be used to fingerprint browser. // @author SkyzohKey // @include http://* -
SkyzohKey revised this gist
Apr 25, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,8 @@ // @include https://* // @run-at document-end // @grant none // @downloadURL https://gist.github.com/SkyzohKey/1f8fe7c070cfe9e98f5dc9ec0c5caee2/raw/screen-spoofer.user.js // @updateURL https://gist.github.com/SkyzohKey/1f8fe7c070cfe9e98f5dc9ec0c5caee2/raw/screen-spoofer.user.js // ==/UserScript== (function() { "use strict"; -
SkyzohKey revised this gist
Apr 25, 2018 . 1 changed file with 2 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -54,26 +54,13 @@ * @see https://developer.mozilla.org/en-US/docs/Web/API/Screen */ }; /** * Initialize script */ var init = function() { // LET SPOOF THAT FUCKIN' RES/COLOR DEPTH spoofScreenResolution(); }; init(); })(); -
SkyzohKey revised this gist
Apr 25, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,8 +8,8 @@ // @include https://* // @run-at document-end // @grant none // @downloadURL https://gist.github.com/SkyzohKey/1f8fe7c070cfe9e98f5dc9ec0c5caee2/raw/7d66029a8306d6822ed47d0daf969adf34fddae1/screen-spoofer.user.js // @updateURL https://gist.github.com/SkyzohKey/1f8fe7c070cfe9e98f5dc9ec0c5caee2/raw/7d66029a8306d6822ed47d0daf969adf34fddae1/screen-spoofer.user.js // ==/UserScript== (function() { "use strict"; -
SkyzohKey created this gist
Apr 25, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,79 @@ // ==UserScript== // @name Spoof screen resolution & color depth // @namespace https://skyzohlabs.be // @version 1.0.0 // @description Spoof the reported window.screen as the most common one so that it can't be used to fingerprint browser. // @author SkyzohKey // @include http://* // @include https://* // @run-at document-end // @grant none // @#downloadURL // @#updateURL // ==/UserScript== (function() { "use strict"; /** * Define property on an object. */ var defineProp = function(obj, prop, val) { Object.defineProperty(obj, prop, { enumerable: true, configurable: true, value: val }); }; /** * Return screen attributes based on the most commons ones. */ var getScreenAttrs = function() { return { width: 1366, height: 768, colorDepth: 24, pixelDepth: 24 }; }; /** * Spoof screen resolution. */ var spoofScreenResolution = function() { var screen = getScreenAttrs(); defineProp(window.screen, "width", screen.width); defineProp(window.screen, "height", screen.height); defineProp(window.screen, "availWidth", screen.width); defineProp(window.screen, "availHeight", screen.height); defineProp(window.screen, "top", 0); defineProp(window.screen, "left", 0); defineProp(window.screen, "availTop", 0); defineProp(window.screen, "availLeft", 0); defineProp(window.screen, "colorDepth", screen.colorDepth); defineProp(window.screen, "pixelDepth", screen.pixelDepth); /** * @todo Implement window.innerHeight, window.innerWidth, etc... * @see https://developer.mozilla.org/en-US/docs/Web/API/Screen */ }; /** * Called on any DOM change to handle "video" tags added dynamically */ var handleDomChange = function(mutations) { if (mutations.length === 0) { spoofScreenResolution(); } }; /** * Initialize script */ var init = function() { // Check existing elements first spoofScreenResolution(); // Set up a mutation observer to handle dynamically added video tags /*var observer = new MutationObserver(handleDomChange); observer.observe(document.body, { childList: true, subtree: true });*/ }; init(); })();