mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-06 19:02:30 +01:00
Fix regression when initializing popup panel
Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1505
Regression from:
- 435c91636f
This commit is contained in:
parent
2128d1cf29
commit
266a7507b8
@ -263,31 +263,29 @@ const firewallRuleTypes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const getFirewallRules = function(src, out) {
|
const getFirewallRules = function(src, out) {
|
||||||
const { hostnameDict } = out;
|
const ruleset = out.firewallRules = {};
|
||||||
const ruleset = {};
|
|
||||||
const df = µb.sessionFirewall;
|
const df = µb.sessionFirewall;
|
||||||
|
|
||||||
for ( const type of firewallRuleTypes ) {
|
for ( const type of firewallRuleTypes ) {
|
||||||
let r = df.lookupRuleData('*', '*', type);
|
const r = df.lookupRuleData('*', '*', type);
|
||||||
if ( r === undefined ) { continue; }
|
if ( r === undefined ) { continue; }
|
||||||
ruleset[`/ * ${type}`] = r;
|
ruleset[`/ * ${type}`] = r;
|
||||||
}
|
}
|
||||||
if ( typeof src !== 'string' ) { return out; }
|
if ( typeof src !== 'string' ) { return; }
|
||||||
|
|
||||||
for ( const type of firewallRuleTypes ) {
|
for ( const type of firewallRuleTypes ) {
|
||||||
let r = df.lookupRuleData(src, '*', type);
|
const r = df.lookupRuleData(src, '*', type);
|
||||||
if ( r === undefined ) { continue; }
|
if ( r === undefined ) { continue; }
|
||||||
ruleset[`. * ${type}`] = r;
|
ruleset[`. * ${type}`] = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { hostnameDict } = out;
|
||||||
for ( const des in hostnameDict ) {
|
for ( const des in hostnameDict ) {
|
||||||
let r = df.lookupRuleData('*', des, '*');
|
let r = df.lookupRuleData('*', des, '*');
|
||||||
if ( r !== undefined ) { ruleset[`/ ${des} *`] = r; }
|
if ( r !== undefined ) { ruleset[`/ ${des} *`] = r; }
|
||||||
r = df.lookupRuleData(src, des, '*');
|
r = df.lookupRuleData(src, des, '*');
|
||||||
if ( r !== undefined ) { ruleset[`. ${des} *`] = r; }
|
if ( r !== undefined ) { ruleset[`. ${des} *`] = r; }
|
||||||
}
|
}
|
||||||
|
|
||||||
out.firewallRules = ruleset;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const popupDataFromTabId = function(tabId, tabTitle) {
|
const popupDataFromTabId = function(tabId, tabTitle) {
|
||||||
@ -358,7 +356,7 @@ const popupDataFromTabId = function(tabId, tabTitle) {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
r.hostnameDict = {};
|
r.hostnameDict = {};
|
||||||
r.firewallRules = getFirewallRules();
|
getFirewallRules(undefined, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
r.matrixIsDirty = µb.sessionFirewall.hasSameRules(
|
r.matrixIsDirty = µb.sessionFirewall.hasSameRules(
|
||||||
|
Loading…
Reference in New Issue
Block a user