Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding modal-disable extension to prevent crawls from getting stuck o…

…n modal dialogs
  • Loading branch information...
commit 532a73b915d0cbb82de005ce12a687618b18c49f 1 parent 68c8457
@jonathanmayer jonathanmayer authored
View
33 crawling/modal-disable/data/content.js
@@ -0,0 +1,33 @@
+// Wrap in a function closure to hide variables
+(function () {
+
+// Bypass the Jetpack DOM wrapper
+//let(window = unsafeWindow) {
+
+// Header guard workaround for Jetpack multiple script loading bug
+if(typeof window.navigator.modalDisabled == "undefined") {
+window.navigator.__defineGetter__("modalDisabled", function() { return true; });
+
+//window.alert
+window.__defineGetter__("alert", function() { return function () { }; });
+
+//window.confirm
+window.__defineGetter__("confirm", function() { return function () { }; });
+
+//window.open
+window.__defineGetter__("open", function() { return function () { }; });
+
+//window.prompt
+window.__defineGetter__("prompt", function() { return function () { return ""; }; });
+
+//window.onbeforeunload
+window.__defineSetter__("onbeforeunload", function() { });
+
+//window.onunload
+//window.__defineSetter__("onunload", function() { });
+
+}
+
+//}
+
+})();
View
10 crawling/modal-disable/lib/main.js
@@ -0,0 +1,10 @@
+var pageMod = require("page-mod");
+const data = require("self").data;
+
+exports.main = function(options, callbacks) {
+ pageMod.PageMod({
+ include: "*",
+ contentScriptWhen: "start",
+ contentScriptFile: data.url("content.js")
+ });
+};
View
BIN  crawling/modal-disable/modal-disable.xpi
Binary file not shown
View
7 crawling/modal-disable/package.json
@@ -0,0 +1,7 @@
+{
+ "id": "modal-disable@fourthparty.info",
+ "fullName": "An extension that disables modal dialogs.",
+ "version": "0.01",
+ "name": "modal-disable",
+ "url": "http://fourthparty.info"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.