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:
@@ -257,19 +257,17 @@ options._openRuleSet = function({target}) {
|
|||||||
let btnCopy = document.getElementById("button-copy-rule-set");
|
let btnCopy = document.getElementById("button-copy-rule-set");
|
||||||
|
|
||||||
let content = "";
|
let content = "";
|
||||||
let ruleSyntax = "";
|
|
||||||
|
|
||||||
if (optionKey === "uMatrix") {
|
|
||||||
ruleSyntax = " script allow";
|
|
||||||
} else if (optionKey === "uBlock") {
|
|
||||||
ruleSyntax = " * noop";
|
|
||||||
}
|
|
||||||
|
|
||||||
textArea.style.display = "block";
|
textArea.style.display = "block";
|
||||||
btnCopy.style.display = "block";
|
btnCopy.style.display = "block";
|
||||||
|
|
||||||
for (var domain in urls) {
|
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+$/, "");
|
textArea.value = content.replace(/\n+$/, "");
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
<li>Added: Swiper JS+CSS v4.5.1 and v5.4.2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/22">#22</a>)</li>
|
<li>Added: Swiper JS+CSS v4.5.1 and v5.4.2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/22">#22</a>)</li>
|
||||||
<li>Added: Cloudflare Mirage2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/22">#22</a>)</li>
|
<li>Added: Cloudflare Mirage2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/22">#22</a>)</li>
|
||||||
<li>Improved: Help page (<a href="https://codeberg.org/nobody/LocalCDN/issues/22">#22</a>)</li>
|
<li>Improved: Help page (<a href="https://codeberg.org/nobody/LocalCDN/issues/22">#22</a>)</li>
|
||||||
|
<li>Improved: uMatrix Rule Generator (<a href="https://codeberg.org/nobody/LocalCDN/issues/23">#23</a>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="topic-label">
|
<div class="topic-label">
|
||||||
Please update your uBlock/uMatrix rules
|
Please update your uBlock/uMatrix rules
|
||||||
|
@@ -32,19 +32,17 @@ updates._openRuleSet = function({target}) {
|
|||||||
let btnCopy = document.getElementById("button-copy-rule-set");
|
let btnCopy = document.getElementById("button-copy-rule-set");
|
||||||
|
|
||||||
let content = "";
|
let content = "";
|
||||||
let ruleSyntax = "";
|
|
||||||
|
|
||||||
if (updateKey === "uMatrix") {
|
|
||||||
ruleSyntax = " script allow";
|
|
||||||
} else if (updateKey === "uBlock") {
|
|
||||||
ruleSyntax = " * noop";
|
|
||||||
}
|
|
||||||
|
|
||||||
textArea.style.display = "block";
|
textArea.style.display = "block";
|
||||||
btnCopy.style.display = "block";
|
btnCopy.style.display = "block";
|
||||||
|
|
||||||
for (var domain in urls) {
|
for (var domain in urls) {
|
||||||
content += "* " + domain + ruleSyntax + '\n';
|
if (updateKey === "uMatrix") {
|
||||||
|
content += "* " + domain + " script allow" + '\n';
|
||||||
|
content += "* " + domain + " css allow" + '\n';
|
||||||
|
} else if (updateKey === "uBlock") {
|
||||||
|
content += "* " + domain + " * noop" + '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
textArea.value = content.replace(/\n+$/, "");
|
textArea.value = content.replace(/\n+$/, "");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user