mirror of https://github.com/gorhill/uBlock.git
Fix regression in handling mode changes
This commit is contained in:
parent
d405460584
commit
56f67631d6
|
@ -214,14 +214,28 @@ async function setFilteringModeDetails(afterDetails) {
|
||||||
|
|
||||||
async function getFilteringMode(hostname) {
|
async function getFilteringMode(hostname) {
|
||||||
const filteringModes = await getFilteringModeDetails();
|
const filteringModes = await getFilteringModeDetails();
|
||||||
if ( filteringModes.none.has(hostname) ) { return 0; }
|
const {
|
||||||
if ( isDescendantHostnameOfIter(hostname, filteringModes.none) ) { return 0; }
|
none,
|
||||||
if ( filteringModes.network.has(hostname) ) { return 1; }
|
network,
|
||||||
if ( isDescendantHostnameOfIter(hostname, filteringModes.network) ) { return 1; }
|
extendedSpecific,
|
||||||
if ( filteringModes.extendedSpecific.has(hostname) ) { return 2; }
|
extendedGeneric,
|
||||||
if ( isDescendantHostnameOfIter(hostname, filteringModes.extendedSpecific) ) { return 2; }
|
} = filteringModes;
|
||||||
if ( filteringModes.extendedGeneric.has(hostname) ) { return 3; }
|
if ( none.has(hostname) ) { return 0; }
|
||||||
if ( isDescendantHostnameOfIter(hostname, filteringModes.extendedGeneric) ) { return 3; }
|
if ( none.has('all-urls') === false ) {
|
||||||
|
if ( isDescendantHostnameOfIter(hostname, none) ) { return 0; }
|
||||||
|
}
|
||||||
|
if ( network.has(hostname) ) { return 1; }
|
||||||
|
if ( network.has('all-urls') === false ) {
|
||||||
|
if ( isDescendantHostnameOfIter(hostname, network) ) { return 1; }
|
||||||
|
}
|
||||||
|
if ( extendedSpecific.has(hostname) ) { return 2; }
|
||||||
|
if ( extendedSpecific.has('all-urls') === false ) {
|
||||||
|
if ( isDescendantHostnameOfIter(hostname, extendedSpecific) ) { return 2; }
|
||||||
|
}
|
||||||
|
if ( extendedGeneric.has(hostname) ) { return 3; }
|
||||||
|
if ( extendedGeneric.has('all-urls') === false ) {
|
||||||
|
if ( isDescendantHostnameOfIter(hostname, extendedGeneric) ) { return 3; }
|
||||||
|
}
|
||||||
return getDefaultFilteringMode();
|
return getDefaultFilteringMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue