diff --git a/platform/mv3/extension/css/strict-block.css b/platform/mv3/extension/css/strictblock.css similarity index 100% rename from platform/mv3/extension/css/strict-block.css rename to platform/mv3/extension/css/strictblock.css diff --git a/platform/mv3/extension/js/popup.js b/platform/mv3/extension/js/popup.js index 7de94450b..98b4d54ce 100644 --- a/platform/mv3/extension/js/popup.js +++ b/platform/mv3/extension/js/popup.js @@ -319,7 +319,7 @@ async function init() { let url; try { - const strictBlockURL = runtime.getURL('/strict-block.html'); + const strictBlockURL = runtime.getURL('/strictblock.'); url = new URL(currentTab.url); if ( url.href.startsWith(strictBlockURL) ) { url = new URL(url.hash.slice(1)); diff --git a/platform/mv3/extension/js/ruleset-manager.js b/platform/mv3/extension/js/ruleset-manager.js index c881d20f8..77b517a9c 100644 --- a/platform/mv3/extension/js/ruleset-manager.js +++ b/platform/mv3/extension/js/ruleset-manager.js @@ -279,15 +279,15 @@ async function updateStrictBlockRules(dynamicRules, sessionRules) { // Fetch strick-block hostnames const toFetch = []; for ( const details of rulesetDetails ) { - if ( details.rules.strictBlock === 0 ) { continue; } - toFetch.push(fetchJSON(`/rulesets/strict-block/${details.id}`)); + if ( details.rules.strictblock === 0 ) { continue; } + toFetch.push(fetchJSON(`/rulesets/strictblock/${details.id}`)); } - const strictBlockRulesets = await Promise.all(toFetch); + const strictblockRulesets = await Promise.all(toFetch); // Strict-block rules can only be enforced with omnipotence let toStrictBlock = new Set(); if ( hasOmnipotence ) { - for ( const hostnames of strictBlockRulesets ) { + for ( const hostnames of strictblockRulesets ) { if ( Array.isArray(hostnames) === false ) { continue; } toStrictBlock = toStrictBlock.union(new Set(hostnames)); } @@ -309,7 +309,7 @@ async function updateStrictBlockRules(dynamicRules, sessionRules) { let strictblockPath = ''; for ( const war of manifest.web_accessible_resources ) { if ( war.resources.length !== 1 ) { continue; } - if ( war.resources[0].startsWith('/strict-block.') === false ) { continue; } + if ( war.resources[0].startsWith('/strictblock.') === false ) { continue; } strictblockPath = runtime.getURL(war.resources[0]); break; } @@ -333,7 +333,7 @@ async function updateStrictBlockRules(dynamicRules, sessionRules) { dynamicRule.condition.excludedRequestDomains = permanentlyExcluded; } dynamicRules.push(dynamicRule); - ubolLog(`Add 1 DNR dynamic rule with ${toStrictBlock.size} strict-blocked domains`); + ubolLog(`Add 1 DNR dynamic rule with ${toStrictBlock.size} strictblock domains`); if ( temporarilyExcluded.length === 0 ) { return; } sessionRules.push({ @@ -347,7 +347,7 @@ async function updateStrictBlockRules(dynamicRules, sessionRules) { }, priority: 29, }); - ubolLog(`Add 1 DNR session rule with ${temporarilyExcluded.length} unstrict-blocked domains`); + ubolLog(`Add 1 DNR session rule with ${temporarilyExcluded.length} excluded strictblock domains`); } /******************************************************************************/ diff --git a/platform/mv3/extension/js/strict-block.js b/platform/mv3/extension/js/strictblock.js similarity index 100% rename from platform/mv3/extension/js/strict-block.js rename to platform/mv3/extension/js/strictblock.js diff --git a/platform/mv3/make-rulesets.js b/platform/mv3/make-rulesets.js index 6fbe1f6e1..b57006705 100644 --- a/platform/mv3/make-rulesets.js +++ b/platform/mv3/make-rulesets.js @@ -455,7 +455,7 @@ async function processNetworkFilters(assetDetails, network) { } if ( strictBlocked.size !== 0 ) { writeFile( - `${rulesetDir}/strict-block/${assetDetails.id}.json`, + `${rulesetDir}/strictblock/${assetDetails.id}.json`, toJSONRuleset(Array.from(strictBlocked)) ); } @@ -469,7 +469,7 @@ async function processNetworkFilters(assetDetails, network) { removeparam: removeparamsGood.length, redirect: redirects.length, modifyHeaders: modifyHeaders.length, - strictBlock: strictBlocked.size, + strictblock: strictBlocked.size, }; } @@ -1113,7 +1113,7 @@ async function rulesetFromURLs(assetDetails) { removeparam: netStats.removeparam, redirect: netStats.redirect, modifyHeaders: netStats.modifyHeaders, - strictBlock: netStats.strictBlock, + strictblock: netStats.strictblock, discarded: netStats.discarded, rejected: netStats.rejected, }, @@ -1363,8 +1363,8 @@ async function main() { // Patch web_accessible_resources key manifest.web_accessible_resources = manifest.web_accessible_resources || []; // Strict-block-related resource - const strictblockDocument = `strict-block.${secret}.html`; - copyFile('./strict-block.html', `${outputDir}/${strictblockDocument}`); + const strictblockDocument = `strictblock.${secret}.html`; + copyFile('./strictblock.html', `${outputDir}/${strictblockDocument}`); manifest.web_accessible_resources.push({ resources: [ `/${strictblockDocument}` ], matches: [ '' ], diff --git a/platform/mv3/strict-block.html b/platform/mv3/strictblock.html similarity index 94% rename from platform/mv3/strict-block.html rename to platform/mv3/strictblock.html index ec0aa04f2..9572eab09 100644 --- a/platform/mv3/strict-block.html +++ b/platform/mv3/strictblock.html @@ -7,7 +7,7 @@ - + @@ -38,6 +38,6 @@ - +