Created
August 21, 2020 13:52
-
-
Save basinilya/0f14fa3e0cfc28e83a94dd612390279e to your computer and use it in GitHub Desktop.
Revisions
-
basinilya created this gist
Aug 21, 2020 .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,25 @@ /// disable-pageview-api.js // Based on: https://addons.mozilla.org/firefox/addon/disable-page-visibility/ // License: http://www.opensource.org/licenses/bsd-license.php (function(){ // visibilitychange events are captured and stopped document.addEventListener("visibilitychange", function(e) { e.stopImmediatePropagation(); }, true); // document.visibilityState always returns false Object.defineProperty(Document.prototype, "hidden", { get: function hidden() { return false; }, enumerable: true, configurable: true }); // document.visibilityState always returns "visible" Object.defineProperty(Document.prototype, "visibilityState", { get: function visibilityState() { return "visible"; }, enumerable: true, configurable: true }); })()