[Pkg-mozext-commits] [greasemonkey] 09/19: Load scripts in about:blank again.

David Prévot taffit at moszumanska.debian.org
Sat Mar 21 02:50:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 0dbdc9aa008ca894a5e98448273b4a37013c1787
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Mon Mar 16 11:12:16 2015 -0400

    Load scripts in about:blank again.
    
    Re-fix #1696 which was re-broken in the e10s migration.
    
    Fixes #2108.
---
 content/framescript.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/content/framescript.js b/content/framescript.js
index 7289d9c..5cc9cd7 100644
--- a/content/framescript.js
+++ b/content/framescript.js
@@ -105,6 +105,14 @@ ContentObserver.prototype.QueryInterface = XPCOMUtils.generateQI([
     Ci.nsIObserver]);
 
 
+ContentObserver.prototype.blankLoad = function(aEvent) {
+  var contentWin = aEvent.target.defaultView;
+  if (contentWin.location.href.match(/^about:blank/)) {
+    // #1696: document-element-inserted doesn't see about:blank
+    this.runScripts('document-end', contentWin);
+  }
+};
+
 ContentObserver.prototype.contentLoad = function(aEvent) {
   var contentWin = aEvent.target.defaultView;
 
@@ -264,6 +272,9 @@ ContentObserver.prototype.runScripts = function(aRunWhen, aContentWin) {
 var contentObserver = new ContentObserver();
 var gContentLoad = contentObserver.contentLoad.bind(contentObserver);
 
+addEventListener(
+    'DOMContentLoaded', contentObserver.blankLoad.bind(contentObserver));
+
 addEventListener('pagehide', contentObserver.pagehide.bind(contentObserver));
 addEventListener('pageshow', contentObserver.pageshow.bind(contentObserver));
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list