1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Improved uMatrix Rule Generator (#23)

This commit is contained in:
nobody
2020-06-07 07:54:44 +02:00
parent bb094dad31
commit df8676c95e
3 changed files with 13 additions and 16 deletions

View File

@@ -257,19 +257,17 @@ options._openRuleSet = function({target}) {
let btnCopy = document.getElementById("button-copy-rule-set");
let content = "";
let ruleSyntax = "";
if (optionKey === "uMatrix") {
ruleSyntax = " script allow";
} else if (optionKey === "uBlock") {
ruleSyntax = " * noop";
}
textArea.style.display = "block";
btnCopy.style.display = "block";
for (var domain in urls) {
content += "* " + domain + ruleSyntax + '\n';
if (optionKey === "uMatrix") {
content += "* " + domain + " script allow" + '\n';
content += "* " + domain + " css allow" + '\n';
} else if (optionKey === "uBlock") {
content += "* " + domain + " * noop" + '\n';
}
}
textArea.value = content.replace(/\n+$/, "");
}