From a8382e821ddcac04e0948bb7375b51479b23a68c Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 3 Jul 2017 09:51:34 -0400 Subject: [PATCH] work around for #2734 until fixed in Nightly --- platform/chromium/vapi-background.js | 2 +- platform/webext/manifest.json | 3 --- src/js/popup.js | 13 ++++++++++++- src/popup.html | 4 ++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 6f8540865..7ee4c5f7a 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -478,12 +478,12 @@ vAPI.tabs.open = function(details) { var targetURLWithoutHash = pos === -1 ? targetURL : targetURL.slice(0, pos); chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) { + if ( chrome.runtime.lastError ) { /* noop */ } var tab = tabs[0]; if ( !tab ) { wrapper(); return; } - var _details = { active: true, url: undefined diff --git a/platform/webext/manifest.json b/platform/webext/manifest.json index 72d1a14e2..e44cb2aef 100644 --- a/platform/webext/manifest.json +++ b/platform/webext/manifest.json @@ -14,19 +14,16 @@ "commands": { "launch-element-zapper": { "suggested_key": { - "default": "Alt+Z" }, "description": "__MSG_popupTipZapper__" }, "launch-element-picker": { "suggested_key": { - "default": "Alt+X" }, "description": "__MSG_popupTipPicker__" }, "launch-logger": { "suggested_key": { - "default": "Alt+L" }, "description": "__MSG_popupTipLog__" } diff --git a/src/js/popup.js b/src/js/popup.js index 84ce67fdb..37c10eccf 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -999,7 +999,6 @@ var onHideTooltip = function() { uDom('#switch').on('click', toggleNetFilteringSwitch); uDom('#gotoZap').on('click', gotoZap); uDom('#gotoPick').on('click', gotoPick); - uDom('a[href]').on('click', gotoURL); uDom('h2').on('click', toggleFirewallPane); uDom('#refresh').on('click', reloadTab); uDom('.hnSwitch').on('click', toggleHostnameSwitch); @@ -1009,6 +1008,18 @@ var onHideTooltip = function() { uDom('body').on('mouseenter', '[data-tip]', onShowTooltip) .on('mouseleave', '[data-tip]', onHideTooltip); + + // https://github.com/gorhill/uBlock/issues/2734 + // Workaround until fixed in Firefox Nightly. + if ( typeof chrome.runtime.getBrowserInfo !== 'function' ) { + uDom('a[href]').on('click', gotoURL); + } else { + chrome.runtime.getBrowserInfo().then(function(info) { + if ( info.name !== 'Firefox' ) { + uDom('a[href]').on('click', gotoURL); + } + }); + } })(); /******************************************************************************/ diff --git a/src/popup.html b/src/popup.html index d8a1223d0..3b303eced 100644 --- a/src/popup.html +++ b/src/popup.html @@ -17,8 +17,8 @@

- - + +