mirror of https://github.com/gorhill/uBlock.git
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.hostnameDict = getHostnameDict(pageStore.hostnameToCountMap);
|
||||||
r.contentLastModified = pageStore.contentLastModified;
|
r.contentLastModified = pageStore.contentLastModified;
|
||||||
r.firewallRules = getFirewallRules(rootHostname, r.hostnameDict);
|
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.noPopups = µb.sessionSwitches.evaluateZ('no-popups', rootHostname);
|
||||||
r.popupBlockedCount = pageStore.popupBlockedCount;
|
r.popupBlockedCount = pageStore.popupBlockedCount;
|
||||||
r.noCosmeticFiltering = µb.sessionSwitches.evaluateZ('no-cosmetic-filtering', rootHostname);
|
r.noCosmeticFiltering = µb.sessionSwitches.evaluateZ('no-cosmetic-filtering', rootHostname);
|
||||||
|
|
|
@ -418,25 +418,25 @@ let updateHnSwitches = function() {
|
||||||
// Assume everything has to be done incrementally.
|
// Assume everything has to be done incrementally.
|
||||||
|
|
||||||
var renderPopup = function() {
|
var renderPopup = function() {
|
||||||
var elem, text;
|
|
||||||
|
|
||||||
if ( popupData.tabTitle ) {
|
if ( popupData.tabTitle ) {
|
||||||
document.title = popupData.appName + ' - ' + popupData.tabTitle;
|
document.title = popupData.appName + ' - ' + popupData.tabTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
elem = document.body;
|
let elem = document.body;
|
||||||
elem.classList.toggle('advancedUser', popupData.advancedUserEnabled);
|
elem.classList.toggle('advancedUser', popupData.advancedUserEnabled);
|
||||||
elem.classList.toggle(
|
elem.classList.toggle(
|
||||||
'off',
|
'off',
|
||||||
popupData.pageURL === '' || !popupData.netFilteringSwitch
|
popupData.pageURL === '' || !popupData.netFilteringSwitch
|
||||||
);
|
);
|
||||||
|
|
||||||
// If you think the `=== true` is pointless, you are mistaken
|
let canElementPicker = popupData.canElementPicker &&
|
||||||
uDom.nodeFromId('gotoPick').classList.toggle('enabled', popupData.canElementPicker === true);
|
popupData.netFilteringSwitch;
|
||||||
uDom.nodeFromId('gotoZap').classList.toggle('enabled', popupData.canElementPicker === true);
|
uDom.nodeFromId('gotoPick').classList.toggle('enabled', canElementPicker);
|
||||||
|
uDom.nodeFromId('gotoZap').classList.toggle('enabled', canElementPicker);
|
||||||
|
|
||||||
var blocked = popupData.pageBlockedRequestCount,
|
let blocked = popupData.pageBlockedRequestCount,
|
||||||
total = popupData.pageAllowedRequestCount + blocked;
|
total = popupData.pageAllowedRequestCount + blocked,
|
||||||
|
text;
|
||||||
if ( total === 0 ) {
|
if ( total === 0 ) {
|
||||||
text = formatNumber(0);
|
text = formatNumber(0);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue