[Pkg-mozext-commits] [tabmixplus] 30/123: [e10s] Follow up bug 1051017 - window.content -> window.gBrowser.selectedBrowser.contentWindowAsCPOW

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:16:24 UTC 2014


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit 4797eef9fedabb4c8c9df066a5edab374308ce7d
Author: onemen <tabmix.onemen at gmail.com>
Date:   Fri Aug 22 23:05:54 2014 +0300

    [e10s] Follow up bug 1051017 - window.content -> window.gBrowser.selectedBrowser.contentWindowAsCPOW
---
 chrome/content/click/click.js           |  5 +++--
 chrome/content/extensions/extensions.js |  2 +-
 modules/Services.jsm                    | 14 ++++++++++++++
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index 51fe1f2..c1f79c0 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -664,7 +664,7 @@ var TabmixContext = {
   openMultipleLinks: function TMP_openMultipleLinks(check) {
     var focusedWindow = document.commandDispatcher.focusedWindow;
     if (focusedWindow == window)
-      focusedWindow = content;
+      focusedWindow = gBrowser.selectedBrowser[TabmixSvc.contentWindowAsCPOW];
 
     var nsISelectionObject = focusedWindow.getSelection();
     if (nsISelectionObject.isCollapsed) // nothing selected
@@ -703,7 +703,8 @@ var TabmixContext = {
     }
 
     var range = nsISelectionObject.getRangeAt(0);
-    var treeWalker = window.content.document.createTreeWalker(
+    var doc = window.gBrowser.selectedBrowser[TabmixSvc.contentDocumentAsCPOW]
+    var treeWalker = doc.createTreeWalker(
          range.cloneContents(),
          NodeFilter.SHOW_ELEMENT,
          myNodeFilter,
diff --git a/chrome/content/extensions/extensions.js b/chrome/content/extensions/extensions.js
index b2465e5..4698ff6 100644
--- a/chrome/content/extensions/extensions.js
+++ b/chrome/content/extensions/extensions.js
@@ -468,7 +468,7 @@ TMP_extensionsCompatibility.RSSTICKER = {
        if (Tabmix.whereToOpen(null).lock)
          this.parent.browser.openInNewTab(this.href);
        else
-         window.content.document.location.href = this.href;
+         window.gBrowser.selectedBrowser[TabmixSvc.contentDocumentAsCPOW].location.href = this.href;
      }
      else if (target == "window") {
        if (Tabmix.singleWindowMode)
diff --git a/modules/Services.jsm b/modules/Services.jsm
index 1b90fdc..ec56636 100644
--- a/modules/Services.jsm
+++ b/modules/Services.jsm
@@ -246,6 +246,20 @@ XPCOMUtils.defineLazyGetter(TabmixSvc, "isLinux", function () {
   return Services.appinfo.OS == "Linux";
 });
 
+/**
+ * bug 1051017 - Firefox 34 - change
+ * browser.contentWindow -> browser.contentWindowAsCPOW
+ * browser.contentDocument -> browser.contentDocumentAsCPOW
+ * window.content -> window.gBrowser.selectedBrowser.contentWindowAsCPOW
+ **/
+XPCOMUtils.defineLazyGetter(TabmixSvc, "contentWindowAsCPOW", function () {
+  return isVersion(340) ? "contentWindowAsCPOW" : "contentWindow";
+});
+
+XPCOMUtils.defineLazyGetter(TabmixSvc, "contentDocumentAsCPOW", function () {
+  return isVersion(340) ? "contentDocumentAsCPOW" : "contentDocument";
+});
+
 XPCOMUtils.defineLazyModuleGetter(TabmixSvc, "FileUtils",
   "resource://gre/modules/FileUtils.jsm");
 

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



More information about the Pkg-mozext-commits mailing list