mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-24 19:33:01 +01:00
minor code review re. 8b5a7aa398
This commit is contained in:
parent
8b1c39507e
commit
1d108082b7
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user