Option page edited

This commit is contained in:
nobody 2021-04-17 06:35:15 +02:00
parent 9b5148eb60
commit bf1a72daa6
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
3 changed files with 3 additions and 22 deletions

View File

@ -351,7 +351,7 @@ div[class="color-picker:a"] {
margin-top: 1em;
}
#tf-domains-allowlist-google-fonts {
#allowedDomainsGoogleFonts {
box-sizing: border-box;
margin-top: 0 !important;
width: 100%;

View File

@ -149,7 +149,7 @@
</div>
<div class="description-option" data-i18n-content="blockGoogleFontsDescription">If you use the rules of the rule generator, requests to "fonts.googleapis.com" are allowed to substitute "Google Material Icons" automatically. If you want to block the other requests, enable this option.</div>
<div id="div-domains-allowlist-google-fonts">
<div class="description-option"><textarea rows="7" id="tf-domains-allowlist-google-fonts" class="input-text without-checkbox" data-option="allowedDomainsGoogleFonts" type="text"></textarea></div>
<div class="description-option"><textarea rows="7" id="allowedDomainsGoogleFonts" class="input-text without-checkbox" data-option="allowedDomainsGoogleFonts" type="text"></textarea></div>
<div class="description-option" data-i18n-content="labelDomainsAllowlistGoogleFonts">These domains are allowed to load Google Fonts. One domain per line.</div>
</div>
</section>
@ -179,7 +179,7 @@
<section class="option">
<div id="html-filter-domains-title-exclude" class="title-option without-checkbox" data-i18n-content="htmlFilterDomainsTitleExclude">Do not apply HTML filter to these domains:</div>
<div id="html-filter-domains-title-include" class="title-option without-checkbox" data-i18n-content="htmlFilterDomainsTitleInclude">Apply HTML filter to these domains:</div>
<textarea rows="7" id="tf-domains-manipulate-dom" class="input-text without-checkbox" data-option="domainsManipulateDOM" type="text"></textarea>
<textarea rows="7" id="domainsManipulateDOM" class="input-text without-checkbox" data-option="domainsManipulateDOM" type="text"></textarea>
<div class="description-option without-checkbox" data-i18n-content="htmlFilterDomainsDescription">Enter the domains to be handled or ignored by the HTML filter. One domain per line.</div>
</section>
<section class="option">

View File

@ -304,23 +304,6 @@ options._changeTab = function ({target}) {
};
/**
* Updates the domain lists if the options page has no focus.
* document.hasFocus() prevents problems with keyboard input.
*/
options._updatesDomainLists = function (changes) {
let changedItems = Object.keys(changes);
if (!document.hasFocus()) {
if (changedItems[0] === 'allowlistedDomains') {
document.getElementById('tf-domains-allowlist').value = options._serializeAllowlistedDomains(changes['allowlistedDomains'].newValue);
} else if (changedItems[0] === 'domainsManipulateDOM') {
document.getElementById('tf-domains-manipulate-dom').value = options._serializeAllowlistedDomains(changes['domainsManipulateDOM'].newValue);
}
}
};
/**
* Initializations
*/
@ -328,5 +311,3 @@ options._updatesDomainLists = function (changes) {
options._storageType = 'local';
document.addEventListener('DOMContentLoaded', options._onDocumentLoaded);
chrome.storage.onChanged.addListener(options._updatesDomainLists);