1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2024-12-22 16:12:13 +01:00

Implemented: Rules for AdGuard (#105)

This commit is contained in:
nobody 2020-09-13 07:42:28 +02:00
parent 7d0a636afc
commit 908d147246
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
4 changed files with 16 additions and 0 deletions

View File

@ -41,6 +41,8 @@ ruleGenerator.openRuleSet = function ({ target }) {
content += '* ' + domain + ' css allow' + '\n';
} else if (key === 'uBlock') {
content += '* ' + domain + ' * noop' + '\n';
} else if (key === 'AdGuard') {
content += '@@||' + domain + '^\n';
}
}
textArea.value = content.replace(/\n+$/, '');

View File

@ -179,6 +179,12 @@
<div class="b-input"></div>
</label>
</div>
<div class="ruleset-generator">
<label class="b-contain" for="generate-adguard-rules">AdGuard
<input id="generate-adguard-rules" name="rule-sets" data-option="AdGuard" type="radio" value="AdGuard">
<div class="b-input"></div>
</label>
</div>
<textarea rows="12" cols="15" id="generated-rules" readonly></textarea>
<button id="button-copy-rule-set" value="Copy"><span data-i18n-content="copyRuleSet">Copy</span><span id="button-copy-rule-set-icon"></span></button>
</section>

View File

@ -169,6 +169,7 @@ options._registerOptionChangedEventListeners = function (elements) {
elements.selectedIcon[2].addEventListener('change', options._onOptionChanged);
elements.ruleSets[0].addEventListener('change', ruleGenerator.openRuleSet);
elements.ruleSets[1].addEventListener('change', ruleGenerator.openRuleSet);
elements.ruleSets[2].addEventListener('change', ruleGenerator.openRuleSet);
elements.copyRuleSet.addEventListener('click', ruleGenerator.copyRuleSet);
elements.internalStatistics.addEventListener('change', options._onOptionChanged);
elements.allowedDomainsGoogleFonts.addEventListener('keyup', options._onOptionChanged);

View File

@ -50,6 +50,7 @@
<li>Updated: popper.js v2.4.4 (<a href="https://codeberg.org/nobody/LocalCDN/issues/103">#103</a>)</li>
<li>Added: AnchorJS v3.2.2 & v4.2.2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/104">#104</a>)</li>
<li>Fixed: Import user settings (<a href="https://codeberg.org/nobody/LocalCDN/issues/102">#102</a>)</li>
<li>Implemented: Rules for AdGuard (<a href="https://codeberg.org/nobody/LocalCDN/issues/105">#105</a>)</li>
</ul>
<div id="generator-section">
<div class="topic-label">
@ -67,6 +68,12 @@
<div class="b-input"></div>
</label>
</div>
<div class="ruleset-generator">
<label class="b-contain" for="generate-adguard-rules">AdGuard
<input id="generate-adguard-rules" name="rule-sets" data-option="AdGuard" type="radio" value="AdGuard">
<div class="b-input"></div>
</label>
</div>
<div>
<textarea rows="12" cols="15" id="generated-rules" readonly></textarea>
<input id="button-copy-rule-set" type="button" value="Copy">