2020-02-27 13:45:29 +01:00
|
|
|
/**
|
|
|
|
* Main Options Page
|
2020-06-30 18:41:58 +02:00
|
|
|
* Belongs to LocalCDN (since 2020-02-26)
|
|
|
|
* (Origin: Decentraleyes)
|
2020-02-27 13:45:29 +01:00
|
|
|
*
|
|
|
|
* @author Thomas Rientjes
|
|
|
|
* @since 2016-08-09
|
2020-06-30 18:41:58 +02:00
|
|
|
*
|
|
|
|
* @author nobody
|
|
|
|
* @since 2020-05-04
|
|
|
|
*
|
2020-02-27 13:45:29 +01:00
|
|
|
* @license MPL 2.0
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Options
|
|
|
|
*/
|
|
|
|
|
|
|
|
var options = {};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Private Methods
|
|
|
|
*/
|
|
|
|
|
|
|
|
options._renderContents = function () {
|
|
|
|
|
2020-04-07 12:19:32 +02:00
|
|
|
let translationComplete = true;
|
|
|
|
|
2020-02-27 13:45:29 +01:00
|
|
|
document.body.setAttribute('dir', options._scriptDirection);
|
2020-04-07 12:19:32 +02:00
|
|
|
translationComplete = helpers.insertI18nContentIntoDocument(document);
|
2020-02-27 13:45:29 +01:00
|
|
|
|
|
|
|
options._determineOptionValues()
|
|
|
|
.then(options._renderOptionsPanel);
|
2020-05-29 08:20:53 +02:00
|
|
|
|
2020-04-07 12:19:32 +02:00
|
|
|
if (!translationComplete) {
|
|
|
|
options._renderLocaleNotice();
|
|
|
|
}
|
|
|
|
|
2020-07-05 08:55:24 +02:00
|
|
|
if(BrowserType.CHROMIUM) {
|
2020-07-12 15:49:37 +02:00
|
|
|
document.getElementById('html-filter-div').style.display = 'none';
|
|
|
|
document.getElementById('block-google-fonts').style.display = 'none';
|
2020-07-05 08:55:24 +02:00
|
|
|
}
|
|
|
|
|
2020-02-27 13:45:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
options._renderOptionsPanel = function () {
|
|
|
|
|
2020-06-25 07:54:17 +02:00
|
|
|
let whitelistedDomains, domainWhitelist, elements, htmlFilterDomains, domainHtmlFilter;
|
2020-02-27 13:45:29 +01:00
|
|
|
|
|
|
|
whitelistedDomains = options._optionValues.whitelistedDomains;
|
|
|
|
domainWhitelist = options._serializeWhitelistedDomains(whitelistedDomains);
|
|
|
|
|
2020-06-25 07:54:17 +02:00
|
|
|
htmlFilterDomains = options._optionValues.domainsManipulateDOM;
|
|
|
|
domainHtmlFilter = options._serializeWhitelistedDomains(htmlFilterDomains);
|
|
|
|
|
2020-02-27 13:45:29 +01:00
|
|
|
elements = options._optionElements;
|
|
|
|
|
|
|
|
elements.showIconBadge.checked = options._optionValues.showIconBadge;
|
|
|
|
elements.blockMissing.checked = options._optionValues.blockMissing;
|
|
|
|
elements.disablePrefetch.checked = options._optionValues.disablePrefetch;
|
|
|
|
elements.stripMetadata.checked = options._optionValues.stripMetadata;
|
2020-04-06 18:04:53 +02:00
|
|
|
elements.hideReleaseNotes.checked = options._optionValues.hideReleaseNotes;
|
2020-03-29 10:23:16 +02:00
|
|
|
elements.enableLogging.checked = options._optionValues.enableLogging;
|
2020-02-27 13:45:29 +01:00
|
|
|
elements.whitelistedDomains.value = domainWhitelist;
|
2020-06-25 07:54:17 +02:00
|
|
|
elements.domainsManipulateDOM.value = domainHtmlFilter;
|
|
|
|
elements.negateHtmlFilterList.checked = options._optionValues.negateHtmlFilterList;
|
2020-07-03 08:37:00 +02:00
|
|
|
elements.blockGoogleFonts.checked = options._optionValues.blockGoogleFonts;
|
2020-07-09 20:58:18 +02:00
|
|
|
elements.selectedIcon.value = options._optionValues.selectedIcon;
|
2020-02-27 13:45:29 +01:00
|
|
|
|
|
|
|
options._registerOptionChangedEventListeners(elements);
|
|
|
|
options._registerMiscellaneousEventListeners();
|
|
|
|
|
|
|
|
if (options._optionValues.blockMissing === true) {
|
|
|
|
options._renderBlockMissingNotice();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (options._languageSupported === false) {
|
|
|
|
options._renderLocaleNotice();
|
|
|
|
}
|
2020-03-08 12:30:03 +01:00
|
|
|
|
2020-07-03 08:37:00 +02:00
|
|
|
options._displayBlockGoogleFonts(options._optionValues.blockMissing);
|
|
|
|
|
2020-06-26 19:49:34 +02:00
|
|
|
if(elements.negateHtmlFilterList.checked === true) {
|
|
|
|
document.getElementById('html-filter-domains-title-include').style.display = "none";
|
|
|
|
document.getElementById('html-filter-domains-title-exclude').style.display = "block";
|
|
|
|
} else {
|
|
|
|
document.getElementById('html-filter-domains-title-include').style.display = "block";
|
|
|
|
document.getElementById('html-filter-domains-title-exclude').style.display = "none";
|
|
|
|
}
|
|
|
|
|
2020-06-16 07:10:22 +02:00
|
|
|
document.getElementById('last-mapping-update').textContent += ' ' + lastMappingUpdate;
|
2020-06-25 07:54:17 +02:00
|
|
|
document.getElementById('negate-html-filter-list-warning').addEventListener('click', options._onClickHTMLFilterWarning);
|
2020-06-28 14:59:07 +02:00
|
|
|
document.getElementById('link-welcome-page').addEventListener('click', options._onClickWelcomePage);
|
|
|
|
document.getElementById('link-changelog').addEventListener('click', options._onClickChangelog);
|
|
|
|
document.getElementById('link-donate').addEventListener('click', options._onClickDonate);
|
2020-07-05 08:50:34 +02:00
|
|
|
document.getElementById('link-faq').addEventListener('click', options._onClickFaq);
|
2020-07-14 20:43:56 +02:00
|
|
|
document.getElementById('ruleset-help-icon').addEventListener('click', options._onClickRulesetHelp);
|
2020-02-27 13:45:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
options._renderBlockMissingNotice = function () {
|
|
|
|
|
|
|
|
let blockMissingNoticeElement = document.getElementById('notice-block-missing');
|
|
|
|
blockMissingNoticeElement.setAttribute('class', 'notice notice-warning');
|
|
|
|
};
|
|
|
|
|
|
|
|
options._hideBlockMissingNotice = function () {
|
|
|
|
|
|
|
|
let blockMissingNoticeElement = document.getElementById('notice-block-missing');
|
|
|
|
blockMissingNoticeElement.setAttribute('class', 'notice notice-warning hidden');
|
|
|
|
};
|
|
|
|
|
|
|
|
options._renderLocaleNotice = function () {
|
|
|
|
|
|
|
|
let localeNoticeElement = document.getElementById('notice-locale');
|
|
|
|
localeNoticeElement.setAttribute('class', 'notice notice-default');
|
|
|
|
};
|
|
|
|
|
|
|
|
options._registerOptionChangedEventListeners = function (elements) {
|
|
|
|
|
|
|
|
elements.showIconBadge.addEventListener('change', options._onOptionChanged);
|
|
|
|
elements.blockMissing.addEventListener('change', options._onOptionChanged);
|
|
|
|
elements.disablePrefetch.addEventListener('change', options._onOptionChanged);
|
|
|
|
elements.stripMetadata.addEventListener('change', options._onOptionChanged);
|
2020-03-29 10:23:16 +02:00
|
|
|
elements.enableLogging.addEventListener('change', options._onOptionChanged);
|
2020-04-06 18:04:53 +02:00
|
|
|
elements.hideReleaseNotes.addEventListener('change', options._onOptionChanged);
|
2020-02-27 13:45:29 +01:00
|
|
|
elements.whitelistedDomains.addEventListener('keyup', options._onOptionChanged);
|
2020-06-25 07:54:17 +02:00
|
|
|
elements.domainsManipulateDOM.addEventListener('keyup', options._onOptionChanged);
|
|
|
|
elements.negateHtmlFilterList.addEventListener('change', options._onOptionChanged);
|
2020-07-03 08:37:00 +02:00
|
|
|
elements.blockGoogleFonts.addEventListener('change', options._onOptionChanged);
|
2020-07-09 20:58:18 +02:00
|
|
|
elements.selectedIcon.addEventListener('change', options._onOptionChanged);
|
2020-03-04 17:55:37 +01:00
|
|
|
let type = elements.ruleSets;
|
|
|
|
for(let i = 0; i < type.length; i++) {
|
|
|
|
type[i].addEventListener('change', options._openRuleSet);
|
|
|
|
}
|
|
|
|
elements.copyRuleSet.addEventListener('click', options._copyRuleSet);
|
2020-02-27 13:45:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
options._registerMiscellaneousEventListeners = function () {
|
|
|
|
|
|
|
|
let blockMissingButtonElement = document.getElementById('button-block-missing');
|
|
|
|
|
|
|
|
blockMissingButtonElement.addEventListener('click', function () {
|
|
|
|
|
|
|
|
let changeEvent = new Event('change');
|
|
|
|
|
|
|
|
options._optionElements.blockMissing.checked = false;
|
|
|
|
options._optionElements.blockMissing.dispatchEvent(changeEvent);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
options._determineOptionValues = function () {
|
|
|
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
|
|
|
let optionKeys = Object.keys(options._optionElements);
|
|
|
|
|
2020-06-08 11:38:52 +02:00
|
|
|
chrome.storage.sync.get(optionKeys, function (items) {
|
2020-02-27 13:45:29 +01:00
|
|
|
|
|
|
|
options._optionValues = items;
|
|
|
|
resolve();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
options._getOptionElement = function (optionKey) {
|
|
|
|
return document.querySelector(`[data-option=${optionKey}]`);
|
|
|
|
};
|
|
|
|
|
|
|
|
options._getOptionElements = function () {
|
|
|
|
|
|
|
|
let optionElements = {
|
|
|
|
[Setting.SHOW_ICON_BADGE]: options._getOptionElement(Setting.SHOW_ICON_BADGE),
|
|
|
|
[Setting.BLOCK_MISSING]: options._getOptionElement(Setting.BLOCK_MISSING),
|
|
|
|
[Setting.DISABLE_PREFETCH]: options._getOptionElement(Setting.DISABLE_PREFETCH),
|
|
|
|
[Setting.STRIP_METADATA]: options._getOptionElement(Setting.STRIP_METADATA),
|
2020-03-04 17:55:37 +01:00
|
|
|
[Setting.WHITELISTED_DOMAINS]: options._getOptionElement(Setting.WHITELISTED_DOMAINS),
|
2020-04-06 18:04:53 +02:00
|
|
|
[Setting.HIDE_RELEASE_NOTES]: options._getOptionElement(Setting.HIDE_RELEASE_NOTES),
|
2020-03-29 10:23:16 +02:00
|
|
|
[Setting.LOGGING]: options._getOptionElement(Setting.LOGGING),
|
2020-03-04 17:55:37 +01:00
|
|
|
['ruleSets']: document.getElementsByName("rule-sets"),
|
2020-06-25 07:54:17 +02:00
|
|
|
['copyRuleSet']: document.getElementById("button-copy-rule-set"),
|
|
|
|
[Setting.NEGATE_HTML_FILTER_LIST]: options._getOptionElement(Setting.NEGATE_HTML_FILTER_LIST),
|
2020-07-03 08:37:00 +02:00
|
|
|
[Setting.DOMAINS_MANIPULATE_DOM]: options._getOptionElement(Setting.DOMAINS_MANIPULATE_DOM),
|
2020-07-08 16:37:03 +02:00
|
|
|
[Setting.BLOCK_GOOGLE_FONTS]: options._getOptionElement(Setting.BLOCK_GOOGLE_FONTS),
|
2020-07-09 20:58:18 +02:00
|
|
|
[Setting.SELECTED_ICON]: options._getOptionElement(Setting.SELECTED_ICON)
|
2020-02-27 13:45:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
return optionElements;
|
|
|
|
};
|
|
|
|
|
|
|
|
options._configureLinkPrefetching = function (value) {
|
|
|
|
|
|
|
|
if (value === false) {
|
|
|
|
|
|
|
|
// Restore default values of related preference values.
|
|
|
|
chrome.privacy.network.networkPredictionEnabled.clear({});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
chrome.privacy.network.networkPredictionEnabled.set({
|
|
|
|
'value': false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
options._serializeWhitelistedDomains = function (whitelistedDomains) {
|
|
|
|
|
2020-06-25 07:54:17 +02:00
|
|
|
if (whitelistedDomains === undefined) return;
|
|
|
|
|
2020-02-27 13:45:29 +01:00
|
|
|
let domainWhitelist, whitelistedDomainKeys;
|
|
|
|
|
|
|
|
whitelistedDomainKeys = Object.keys(whitelistedDomains);
|
|
|
|
domainWhitelist = '';
|
|
|
|
|
|
|
|
whitelistedDomainKeys.forEach(function (domain) {
|
|
|
|
domainWhitelist = `${domainWhitelist}${domain};`;
|
|
|
|
});
|
|
|
|
|
|
|
|
domainWhitelist = domainWhitelist.slice(0, -1);
|
|
|
|
domainWhitelist = domainWhitelist.replace(Whitelist.TRIM_EXPRESSION, '');
|
|
|
|
|
|
|
|
return domainWhitelist;
|
|
|
|
};
|
|
|
|
|
|
|
|
options._parseDomainWhitelist = function (domainWhitelist) {
|
|
|
|
|
|
|
|
let whitelistedDomains = {};
|
|
|
|
|
|
|
|
domainWhitelist.split(Whitelist.VALUE_SEPARATOR).forEach(function (domain) {
|
|
|
|
whitelistedDomains[helpers.normalizeDomain(domain)] = true;
|
|
|
|
});
|
|
|
|
|
|
|
|
return whitelistedDomains;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event Handlers
|
|
|
|
*/
|
|
|
|
|
|
|
|
options._onDocumentLoaded = function () {
|
|
|
|
|
|
|
|
let language = navigator.language;
|
|
|
|
|
|
|
|
options._optionElements = options._getOptionElements();
|
|
|
|
options._languageSupported = helpers.languageIsFullySupported(language);
|
|
|
|
options._scriptDirection = helpers.determineScriptDirection(language);
|
|
|
|
|
|
|
|
options._renderContents();
|
|
|
|
};
|
|
|
|
|
|
|
|
options._onOptionChanged = function ({target}) {
|
|
|
|
|
|
|
|
let optionKey, optionType, optionValue;
|
|
|
|
|
|
|
|
optionKey = target.getAttribute('data-option');
|
|
|
|
optionType = target.getAttribute('type');
|
|
|
|
|
2020-06-21 08:18:18 +02:00
|
|
|
if (optionType === 'checkbox') {
|
2020-02-27 13:45:29 +01:00
|
|
|
optionValue = target.checked;
|
2020-06-21 08:18:18 +02:00
|
|
|
} else {
|
2020-02-27 13:45:29 +01:00
|
|
|
optionValue = target.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (optionKey === Setting.BLOCK_MISSING) {
|
|
|
|
|
|
|
|
if (optionValue === true) {
|
|
|
|
options._renderBlockMissingNotice();
|
2020-07-03 08:37:00 +02:00
|
|
|
options._displayBlockGoogleFonts(true);
|
2020-02-27 13:45:29 +01:00
|
|
|
} else {
|
|
|
|
options._hideBlockMissingNotice();
|
2020-07-03 08:37:00 +02:00
|
|
|
options._displayBlockGoogleFonts(false);
|
2020-02-27 13:45:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (optionKey === Setting.DISABLE_PREFETCH) {
|
|
|
|
options._configureLinkPrefetching(optionValue);
|
|
|
|
}
|
|
|
|
|
2020-06-25 07:54:17 +02:00
|
|
|
if (optionKey === Setting.WHITELISTED_DOMAINS || optionKey === Setting.DOMAINS_MANIPULATE_DOM) {
|
2020-02-27 13:45:29 +01:00
|
|
|
optionValue = options._parseDomainWhitelist(optionValue);
|
|
|
|
}
|
|
|
|
|
2020-06-26 19:49:34 +02:00
|
|
|
if (optionKey === Setting.NEGATE_HTML_FILTER_LIST) {
|
|
|
|
if(optionValue === true) {
|
|
|
|
document.getElementById('html-filter-domains-title-include').style.display = "none";
|
|
|
|
document.getElementById('html-filter-domains-title-exclude').style.display = "block";
|
|
|
|
} else {
|
|
|
|
document.getElementById('html-filter-domains-title-include').style.display = "block";
|
|
|
|
document.getElementById('html-filter-domains-title-exclude').style.display = "none";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-09 20:58:18 +02:00
|
|
|
if (optionKey === Setting.SELECTED_ICON) {
|
2020-07-08 16:37:03 +02:00
|
|
|
wrappers.setIcon({
|
2020-07-09 20:58:18 +02:00
|
|
|
'path': optionValue
|
|
|
|
}, 'Enabled');
|
2020-07-08 16:37:03 +02:00
|
|
|
}
|
|
|
|
|
2020-06-08 11:38:52 +02:00
|
|
|
chrome.storage.sync.set({
|
2020-02-27 13:45:29 +01:00
|
|
|
[optionKey]: optionValue
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2020-03-04 17:55:37 +01:00
|
|
|
options._openRuleSet = function({target}) {
|
|
|
|
|
|
|
|
let urls = mappings;
|
|
|
|
let optionKey = target.getAttribute('data-option');
|
|
|
|
let textArea = document.getElementById("generated-rules");
|
|
|
|
let btnCopy = document.getElementById("button-copy-rule-set");
|
|
|
|
let content = "";
|
|
|
|
|
|
|
|
textArea.style.display = "block";
|
|
|
|
btnCopy.style.display = "block";
|
|
|
|
|
|
|
|
for (var domain in urls) {
|
2020-06-07 07:54:44 +02:00
|
|
|
if (optionKey === "uMatrix") {
|
|
|
|
content += "* " + domain + " script allow" + '\n';
|
|
|
|
content += "* " + domain + " css allow" + '\n';
|
|
|
|
} else if (optionKey === "uBlock") {
|
|
|
|
content += "* " + domain + " * noop" + '\n';
|
|
|
|
}
|
2020-03-04 17:55:37 +01:00
|
|
|
}
|
|
|
|
textArea.value = content.replace(/\n+$/, "");
|
2020-06-30 18:44:50 +02:00
|
|
|
};
|
2020-03-04 17:55:37 +01:00
|
|
|
|
|
|
|
options._copyRuleSet = function() {
|
|
|
|
let textArea = document.getElementById("generated-rules");
|
|
|
|
navigator.clipboard.writeText(textArea.value).then(function() {
|
|
|
|
textArea.select();
|
|
|
|
}, function() {
|
|
|
|
alert("Rule set cannot be copied!");
|
|
|
|
});
|
2020-06-30 18:44:50 +02:00
|
|
|
};
|
2020-03-04 17:55:37 +01:00
|
|
|
|
2020-06-25 07:54:17 +02:00
|
|
|
options._onClickHTMLFilterWarning = function() {
|
|
|
|
chrome.tabs.create({
|
|
|
|
'url': 'https://codeberg.org/nobody/LocalCDN/wiki/Blank-websites-or-weird-characters',
|
|
|
|
'active': true
|
|
|
|
});
|
2020-06-30 18:44:50 +02:00
|
|
|
};
|
2020-06-25 07:54:17 +02:00
|
|
|
|
2020-06-28 14:59:07 +02:00
|
|
|
options._onClickWelcomePage = function() {
|
|
|
|
chrome.tabs.create({
|
|
|
|
'url': chrome.extension.getURL('pages/welcome/welcome.html'),
|
|
|
|
'active': true
|
|
|
|
});
|
2020-06-30 18:44:50 +02:00
|
|
|
};
|
2020-06-28 14:59:07 +02:00
|
|
|
|
|
|
|
options._onClickDonate = function() {
|
|
|
|
chrome.tabs.create({
|
|
|
|
'url': chrome.extension.getURL('pages/donate/donate.html'),
|
|
|
|
'active': true
|
|
|
|
});
|
2020-06-30 18:44:50 +02:00
|
|
|
};
|
2020-06-28 14:59:07 +02:00
|
|
|
|
|
|
|
options._onClickChangelog = function() {
|
|
|
|
chrome.tabs.create({
|
|
|
|
'url': chrome.extension.getURL('pages/updates/updates.html'),
|
|
|
|
'active': true
|
|
|
|
});
|
2020-06-30 18:44:50 +02:00
|
|
|
};
|
2020-06-28 14:59:07 +02:00
|
|
|
|
2020-07-05 08:50:34 +02:00
|
|
|
options._onClickFaq = function() {
|
|
|
|
chrome.tabs.create({
|
|
|
|
'url': chrome.extension.getURL('pages/help/help.html'),
|
|
|
|
'active': true
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2020-07-14 20:43:56 +02:00
|
|
|
options._onClickRulesetHelp = function() {
|
|
|
|
chrome.tabs.create({
|
|
|
|
'url': 'https://codeberg.org/nobody/LocalCDN/wiki/Ruleset-generator-for-uBlock-Origin-or-uMatrix',
|
|
|
|
'active': true
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2020-06-30 18:51:00 +02:00
|
|
|
/**
|
|
|
|
* 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] === 'whitelistedDomains') {
|
|
|
|
document.getElementById('tf-domains-whitelist').value = options._serializeWhitelistedDomains(changes['whitelistedDomains'].newValue);
|
|
|
|
} else if (changedItems[0] === 'domainsManipulateDOM') {
|
|
|
|
document.getElementById('tf-domains-manipulate-dom').value = options._serializeWhitelistedDomains(changes['domainsManipulateDOM'].newValue);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// document has the focus
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-07-03 08:37:00 +02:00
|
|
|
options._displayBlockGoogleFonts = function(value) {
|
|
|
|
if (value === true) {
|
2020-07-05 06:44:53 +02:00
|
|
|
document.getElementById('block-google-fonts').classList.add('option-disabled');
|
|
|
|
document.getElementById('block-google-fonts-chk').disabled = true;
|
2020-07-03 08:37:00 +02:00
|
|
|
} else {
|
2020-07-05 06:44:53 +02:00
|
|
|
document.getElementById('block-google-fonts').classList.remove('option-disabled');
|
|
|
|
document.getElementById('block-google-fonts-chk').disabled = false;
|
2020-07-03 08:37:00 +02:00
|
|
|
}
|
|
|
|
};
|
2020-06-30 18:51:00 +02:00
|
|
|
|
2020-02-27 13:45:29 +01:00
|
|
|
/**
|
|
|
|
* Initializations
|
|
|
|
*/
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', options._onDocumentLoaded);
|
2020-06-30 18:51:00 +02:00
|
|
|
|
|
|
|
chrome.storage.onChanged.addListener(options._updatesDomainLists);
|