mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] "Enable strict blocking" setting depends on broad host permissions
This commit is contained in:
parent
7c5c93f073
commit
51db128dc2
2 changed files with 11 additions and 1 deletions
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
import {
|
||||
broadcastMessage,
|
||||
hasBroadHostPermissions,
|
||||
hostnamesFromMatches,
|
||||
isDescendantHostnameOfIter,
|
||||
toBroaderHostname,
|
||||
|
|
@ -255,12 +256,14 @@ async function writeFilteringModeDetails(afterDetails) {
|
|||
return Promise.all([
|
||||
getDefaultFilteringMode(),
|
||||
getTrustedSites(),
|
||||
hasBroadHostPermissions(),
|
||||
localWrite('filteringModeDetails', data),
|
||||
sessionWrite('filteringModeDetails', data),
|
||||
]).then(results => {
|
||||
broadcastMessage({
|
||||
defaultFilteringMode: results[0],
|
||||
trustedSites: Array.from(results[1]),
|
||||
hasOmnipotence: results[2],
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ function renderWidgets() {
|
|||
|
||||
{
|
||||
const input = qs$('#strictBlockMode input[type="checkbox"]');
|
||||
const canStrictBlock = cachedRulesetData.defaultFilteringMode > 1;
|
||||
const canStrictBlock = cachedRulesetData.hasOmnipotence;
|
||||
input.checked = canStrictBlock && cachedRulesetData.strictBlockMode;
|
||||
dom.attr(input, 'disabled', canStrictBlock ? null : '');
|
||||
}
|
||||
|
|
@ -235,6 +235,13 @@ listen.onmessage = ev => {
|
|||
}
|
||||
}
|
||||
|
||||
if ( message.hasOmnipotence !== undefined ) {
|
||||
if ( message.hasOmnipotence !== local.hasOmnipotence ) {
|
||||
local.hasOmnipotence = message.hasOmnipotence;
|
||||
render = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( message.defaultFilteringMode !== undefined ) {
|
||||
if ( message.defaultFilteringMode !== local.defaultFilteringMode ) {
|
||||
local.defaultFilteringMode = message.defaultFilteringMode;
|
||||
|
|
|
|||
Loading…
Reference in a new issue