[Pkg-mozext-commits] [itsalltext] 256/459: * Only do pageload and pageunload on real documents * fixed the onContextMenu again. How easy that breaks.

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:27 UTC 2015


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

taffit pushed a commit to branch master
in repository itsalltext.

commit a23588e5080f09b068f3aa7ac1d0f76dacbdf581
Author: docwhat at gerf.org <docwhat at gerf.org>
Date:   Thu Jun 21 10:49:01 2007 -0400

    * Only do pageload and pageunload on real documents
    * fixed the onContextMenu again.  How easy that breaks.
---
 src/chrome/content/cacheobj.js   |  2 +-
 src/chrome/content/itsalltext.js | 14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/chrome/content/cacheobj.js b/src/chrome/content/cacheobj.js
index 61a2666..87de5c3 100644
--- a/src/chrome/content/cacheobj.js
+++ b/src/chrome/content/cacheobj.js
@@ -469,7 +469,7 @@ CacheObj.prototype.onContext = function(event) {
      */
     var cobj = ItsAllText.getCacheObj(event.target);
     var popup = ItsAllText.rebuildMenu(cobj.uid);
-    event.target.ownerDocument.popupNode = popup;
+    document.popupNode = popup;
     popup.showPopup(popup,
                     event.screenX, event.screenY,
                     'context', null, null);
diff --git a/src/chrome/content/itsalltext.js b/src/chrome/content/itsalltext.js
index 5539c62..53adbbb 100644
--- a/src/chrome/content/itsalltext.js
+++ b/src/chrome/content/itsalltext.js
@@ -835,8 +835,11 @@ ItsAllText.prototype.getLocale = function() {
  * @private
  */
 ItsAllText.prototype.pageload = function(event) {
-    var doc = event.originalTarget || document;
-    this.debug("pageload(): A page has been loaded");
+    var doc = event.originalTarget;
+    if (!doc || doc.nodeName != "#document") { 
+        return;
+    }
+    this.debug("pageload(): A page has been loaded:",doc);
     
     // Start watching the preferences.
     this.preference_observer.register();
@@ -870,8 +873,11 @@ ItsAllText.prototype.pageload = function(event) {
  * @private
  */
 ItsAllText.prototype.pageunload = function(event) {
-    var doc = event.originalTarget||document;
-    this.debug("pageunload(): A page has been unloaded");
+    var doc = event.originalTarget;
+    if (!doc || doc.nodeName != "#document") { 
+        return;
+    }
+    this.debug("pageunload(): A page has been unloaded",doc);
     this.monitor.unwatch(doc);
     this.preference_observer.unregister();
     this.cleanCacheObjs();

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



More information about the Pkg-mozext-commits mailing list