[Pkg-mozext-commits] [greasemonkey] 12/62: addTab => timeout function

David Prévot taffit at moszumanska.debian.org
Sun Sep 13 22:10:20 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 a60a3aeed3d9c7d180454ea7dbc2d545dcf9ac01
Author: janekptacijarabaci <janekptacijarabaci at seznam.cz>
Date:   Tue Aug 18 14:58:18 2015 +0200

    addTab => timeout function
---
 content/browser.js      | 32 +++++++++++++++++---------------
 modules/GM_openInTab.js |  2 +-
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/content/browser.js b/content/browser.js
index 1b71668..d3c0448 100644
--- a/content/browser.js
+++ b/content/browser.js
@@ -70,21 +70,23 @@ GM_BrowserUI.openInTab = function(aMessage) {
   var tabBrowser = browser.getTabBrowser();
   var scriptTab = tabBrowser.getTabForBrowser(browser);
   var scriptTabIsCurrentTab = scriptTab == tabBrowser.mCurrentTab;
-  var newTab = tabBrowser.addTab(
-      aMessage.data.url,
-      {
-          'ownerTab': scriptTab,
-          'relatedToCurrent': scriptTabIsCurrentTab,
-      });
-
-  var getBool = Services.prefs.getBoolPref;
-
-  var prefBg = getBool('browser.tabs.loadInBackground');
-  prefBg |= aMessage.data.inBackground;
-  if (scriptTabIsCurrentTab && !prefBg) tabBrowser.selectedTab = newTab;
-
-  var prefRel = getBool('browser.tabs.insertRelatedAfterCurrent');
-  if (prefRel) tabBrowser.moveTabTo(newTab, scriptTab._tPos + 1);
+  GM_util.timeout(function() {
+    var newTab = tabBrowser.addTab(
+        aMessage.data.url,
+        {
+            'ownerTab': scriptTab,
+            'relatedToCurrent': scriptTabIsCurrentTab,
+        });
+
+    var getBool = Services.prefs.getBoolPref;
+
+    var prefBg = getBool('browser.tabs.loadInBackground');
+    prefBg |= aMessage.data.inBackground;
+    if (scriptTabIsCurrentTab && !prefBg) tabBrowser.selectedTab = newTab;
+
+    var prefRel = getBool('browser.tabs.insertRelatedAfterCurrent');
+    if (prefRel) tabBrowser.moveTabTo(newTab, scriptTab._tPos + 1);
+  }, 0);
 };
 
 /**
diff --git a/modules/GM_openInTab.js b/modules/GM_openInTab.js
index 0ba90ee..99585c7 100644
--- a/modules/GM_openInTab.js
+++ b/modules/GM_openInTab.js
@@ -15,7 +15,7 @@ function GM_openInTab(aFrame, aBaseUrl, aUrl, aInBackground) {
   var baseUri = Services.io.newURI(aBaseUrl, null, null);
   var uri = Services.io.newURI(aUrl, null, baseUri);
 
-  aFrame.sendRpcMessage('greasemonkey:open-in-tab', {
+  aFrame.sendAsyncMessage('greasemonkey:open-in-tab', {
     inBackground: loadInBackground,
     url: uri.spec,
   });

-- 
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