minor code review re. 8b5a7aa398

This commit is contained in:
Raymond Hill 2018-09-07 10:52:10 -04:00
parent 8b1c39507e
commit 1d108082b7
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

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