Skip to content

Commit a8382e8

Browse files
committed
work around for gorhill#2734 until fixed in Nightly
1 parent 20346ef commit a8382e8

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

platform/chromium/vapi-background.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,12 @@ vAPI.tabs.open = function(details) {
478478
var targetURLWithoutHash = pos === -1 ? targetURL : targetURL.slice(0, pos);
479479

480480
chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) {
481+
if ( chrome.runtime.lastError ) { /* noop */ }
481482
var tab = tabs[0];
482483
if ( !tab ) {
483484
wrapper();
484485
return;
485486
}
486-
487487
var _details = {
488488
active: true,
489489
url: undefined

platform/webext/manifest.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,16 @@
1414
"commands": {
1515
"launch-element-zapper": {
1616
"suggested_key": {
17-
"default": "Alt+Z"
1817
},
1918
"description": "__MSG_popupTipZapper__"
2019
},
2120
"launch-element-picker": {
2221
"suggested_key": {
23-
"default": "Alt+X"
2422
},
2523
"description": "__MSG_popupTipPicker__"
2624
},
2725
"launch-logger": {
2826
"suggested_key": {
29-
"default": "Alt+L"
3027
},
3128
"description": "__MSG_popupTipLog__"
3229
}

src/js/popup.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,6 @@ var onHideTooltip = function() {
999999
uDom('#switch').on('click', toggleNetFilteringSwitch);
10001000
uDom('#gotoZap').on('click', gotoZap);
10011001
uDom('#gotoPick').on('click', gotoPick);
1002-
uDom('a[href]').on('click', gotoURL);
10031002
uDom('h2').on('click', toggleFirewallPane);
10041003
uDom('#refresh').on('click', reloadTab);
10051004
uDom('.hnSwitch').on('click', toggleHostnameSwitch);
@@ -1009,6 +1008,18 @@ var onHideTooltip = function() {
10091008

10101009
uDom('body').on('mouseenter', '[data-tip]', onShowTooltip)
10111010
.on('mouseleave', '[data-tip]', onHideTooltip);
1011+
1012+
// https://github.com/gorhill/uBlock/issues/2734
1013+
// Workaround until fixed in Firefox Nightly.
1014+
if ( typeof chrome.runtime.getBrowserInfo !== 'function' ) {
1015+
uDom('a[href]').on('click', gotoURL);
1016+
} else {
1017+
chrome.runtime.getBrowserInfo().then(function(info) {
1018+
if ( info.name !== 'Firefox' ) {
1019+
uDom('a[href]').on('click', gotoURL);
1020+
}
1021+
});
1022+
}
10121023
})();
10131024

10141025
/******************************************************************************/

src/popup.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<p id="basicTools">
1818
<span id="gotoZap" class="fa tool" data-i18n-tip="popupTipZapper" data-tip-position="under">&#xf0e7;</span>
1919
<span id="gotoPick" class="fa tool" data-i18n-tip="popupTipPicker" data-tip-position="under">&#xf1fb;</span>
20-
<a href="logger-ui.html" class="fa tool enabled" data-i18n-tip="popupTipLog" data-tip-position="under">&#xf022;</a>
21-
<a href="dashboard.html" class="fa tool enabled" data-i18n-tip="popupTipDashboard" data-tip-position="under">&#xf085;</a>
20+
<a href="logger-ui.html" class="fa tool enabled" data-i18n-tip="popupTipLog" data-tip-position="under" target="uBOLogger">&#xf022;</a>
21+
<a href="dashboard.html" class="fa tool enabled" data-i18n-tip="popupTipDashboard" data-tip-position="under" target="uBODashboard">&#xf085;</a>
2222
</p>
2323
<h2 id="dfToggler" data-i18n="popupBlockedRequestPrompt">&nbsp;</h2>
2424
<p class="statName">

0 commit comments

Comments
 (0)