diff --git a/src/js/messaging.js b/src/js/messaging.js index ea20bb7ca..ae7c40fa7 100644 --- a/src/js/messaging.js +++ b/src/js/messaging.js @@ -325,7 +325,7 @@ var popupDataFromTabId = function(tabId, tabTitle) { r.hostnameDict = getHostnameDict(pageStore.hostnameToCountMap); r.contentLastModified = pageStore.contentLastModified; r.firewallRules = getFirewallRules(rootHostname, r.hostnameDict); - r.canElementPicker = µb.URI.isNetworkURI(r.rawURL) && r.netFilteringSwitch; + r.canElementPicker = µb.URI.isNetworkURI(r.rawURL); r.noPopups = µb.sessionSwitches.evaluateZ('no-popups', rootHostname); r.popupBlockedCount = pageStore.popupBlockedCount; r.noCosmeticFiltering = µb.sessionSwitches.evaluateZ('no-cosmetic-filtering', rootHostname); diff --git a/src/js/popup.js b/src/js/popup.js index f59e28578..74f54ff8d 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -418,25 +418,25 @@ let updateHnSwitches = function() { // Assume everything has to be done incrementally. var renderPopup = function() { - var elem, text; - if ( popupData.tabTitle ) { document.title = popupData.appName + ' - ' + popupData.tabTitle; } - elem = document.body; + let elem = document.body; elem.classList.toggle('advancedUser', popupData.advancedUserEnabled); elem.classList.toggle( 'off', popupData.pageURL === '' || !popupData.netFilteringSwitch ); - // If you think the `=== true` is pointless, you are mistaken - uDom.nodeFromId('gotoPick').classList.toggle('enabled', popupData.canElementPicker === true); - uDom.nodeFromId('gotoZap').classList.toggle('enabled', popupData.canElementPicker === true); + let canElementPicker = popupData.canElementPicker && + popupData.netFilteringSwitch; + uDom.nodeFromId('gotoPick').classList.toggle('enabled', canElementPicker); + uDom.nodeFromId('gotoZap').classList.toggle('enabled', canElementPicker); - var blocked = popupData.pageBlockedRequestCount, - total = popupData.pageAllowedRequestCount + blocked; + let blocked = popupData.pageBlockedRequestCount, + total = popupData.pageAllowedRequestCount + blocked, + text; if ( total === 0 ) { text = formatNumber(0); } else {