From 601a446dbf9f0d72b1464f26b283ea40d667f00e Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 7 Jun 2021 06:39:55 +0200 Subject: [PATCH] Ruleset generator for NoScript (#489) --- modules/internal/rule-generator.js | 2 ++ pages/options/options-advanced.js | 1 + pages/options/options.html | 6 ++++++ pages/updates/updates.html | 8 +++++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/internal/rule-generator.js b/modules/internal/rule-generator.js index fbd19c12..3f9ca297 100644 --- a/modules/internal/rule-generator.js +++ b/modules/internal/rule-generator.js @@ -46,6 +46,8 @@ ruleGenerator.openRuleSet = function ({target}) { content += `* ${domain} * noop\n`; } else if (key === 'AdGuard') { content += `@@||${domain}^\n`; + } else if (key === 'NoScript') { + content += `"$:${domain}",\n`; } } textArea.value = content.replace(/\n+$/, ''); diff --git a/pages/options/options-advanced.js b/pages/options/options-advanced.js index 2e6ad1b6..4f785c93 100644 --- a/pages/options/options-advanced.js +++ b/pages/options/options-advanced.js @@ -95,6 +95,7 @@ optionsAdvanced.init = function (opt) { document.getElementById('generate-ublock-rules').addEventListener('change', ruleGenerator.openRuleSet); document.getElementById('generate-umatrix-rules').addEventListener('change', ruleGenerator.openRuleSet); document.getElementById('generate-adguard-rules').addEventListener('change', ruleGenerator.openRuleSet); + document.getElementById('generate-noscript-rules').addEventListener('change', ruleGenerator.openRuleSet); document.getElementById('button-copy-rule-set').addEventListener('click', ruleGenerator.copyRuleSet); document.getElementById('negate-html-filter-list-warning').addEventListener('click', function () { options._onLinkClick(Links.CODEBERG_HTML_FILTER); }); document.getElementById('ruleset-help').addEventListener('click', function () { options._onLinkClick(Links.CODEBERG_RULESET); }); diff --git a/pages/options/options.html b/pages/options/options.html index 7bbbcf1d..e1e70a54 100644 --- a/pages/options/options.html +++ b/pages/options/options.html @@ -227,6 +227,12 @@
+
+ +
diff --git a/pages/updates/updates.html b/pages/updates/updates.html index e033e04a..c5c821e1 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -25,7 +25,7 @@ New in LocalCDN:
@@ -49,6 +49,12 @@
+
+ +