visibility.js - firefox-fix-web - Firefox extension: fix web
HTML git clone git://git.codemadness.org/firefox-fix-web
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
visibility.js (772B)
---
1 // from: https://addons.mozilla.org/en-US/firefox/addon/disable-page-visibility/
2
3 // visibilitychange events are captured and stopped
4 document.addEventListener("visibilitychange", function(e) {
5 e.stopImmediatePropagation();
6 }, true, true);
7
8 // document.visibilityState always returns false
9 Object.defineProperty(Document.prototype.wrappedJSObject, "hidden", {
10 get: exportFunction(function hidden() { return false; }, window.wrappedJSObject),
11 enumerable: true, configurable: true
12 });
13
14 // document.visibilityState always returns "visible"
15 Object.defineProperty(Document.prototype.wrappedJSObject, "visibilityState", {
16 get: exportFunction(function visibilityState() { return "visible"; }, window.wrappedJSObject),
17 enumerable: true, configurable: true
18 });