Skip to content

Instantly share code, notes, and snippets.

@Ventero
Created July 16, 2012 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ventero/3125215 to your computer and use it in GitHub Desktop.
Save Ventero/3125215 to your computer and use it in GitHub Desktop.
GM issue 1584 diff #2
diff --git a/components/greasemonkey.js b/components/greasemonkey.js
index 4863722..559d178 100644
--- a/components/greasemonkey.js
+++ b/components/greasemonkey.js
@@ -322,6 +322,7 @@ function startup(aService) {
var observerService = Components.classes['@mozilla.org/observer-service;1']
.getService(Components.interfaces.nsIObserverService);
observerService.addObserver(aService, 'document-element-inserted', false);
+ observerService.addObserver(aService, 'content-document-global-created', false);
}
/////////////////////////////////// Service ////////////////////////////////////
@@ -405,6 +406,15 @@ service.prototype.observe = function(aSubject, aTopic, aData) {
var win = doc.defaultView;
this.runScripts('document-start', win);
break;
+ case 'content-document-global-created':
+ var win = aSubject;
+ var self = this;
+ if (!GM_util.isGreasemonkeyable(win.location.href)) break;
+ win.addEventListener("DOMContentLoaded", function _inject(){
+ win.removeEventListener("DOMContentLoaded", _inject, false);
+ self.runScripts('document-end', win);
+ }, false);
+ break;
}
};
diff --git a/content/browser.js b/content/browser.js
index e6e9556..1638fdb 100644
--- a/content/browser.js
+++ b/content/browser.js
@@ -72,6 +72,7 @@ GM_BrowserUI.chromeLoad = function(e) {
};
GM_BrowserUI.contentLoad = function(event) {
+ return;
if (!GM_util.getEnabled()) return;
var safeWin = event.target.defaultView;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment