parent
aa8e1fba72
commit
b05de30c76
|
@ -198,6 +198,16 @@ const Regex = {
|
|||
'FONT_AWESOME_WITH_CODE': /use\.fontawesome\.com\/[a-z0-9]{10}\.js/
|
||||
};
|
||||
|
||||
const Links = {
|
||||
'CODEBERG_HTML_FILTER': 'https://codeberg.org/nobody/LocalCDN/wiki/Blank-websites-or-weird-characters',
|
||||
'CODEBERG_RULESET': 'https://codeberg.org/nobody/LocalCDN/wiki/Ruleset-generator-for-uBlock-Origin-or-uMatrix',
|
||||
'WELCOME': chrome.extension.getURL('pages/welcome/welcome.html'),
|
||||
'DONATE': chrome.extension.getURL('pages/donate/donate.html'),
|
||||
'CHANGELOG': chrome.extension.getURL('pages/updates/updates.html'),
|
||||
'FAQ': chrome.extension.getURL('pages/help/help.html'),
|
||||
'STATISTICS': chrome.extension.getURL('pages/statistics/statistics.html')
|
||||
};
|
||||
|
||||
// Supported charsets for TextDecoder()
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/TextDecoder
|
||||
const EncodingTypes = {
|
||||
|
|
|
@ -64,7 +64,6 @@ a:hover {
|
|||
}
|
||||
|
||||
.b-contain span {
|
||||
line-height: 1.54;
|
||||
font-size: 12px;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
@ -74,6 +73,7 @@ a:hover {
|
|||
position: relative;
|
||||
padding-left: 25px;
|
||||
cursor: pointer;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.b-contain input[type="checkbox"] ~ .b-input {
|
||||
|
|
|
@ -14,6 +14,24 @@ body {
|
|||
margin-right: auto;
|
||||
}
|
||||
|
||||
.option-buttons {
|
||||
border: none;
|
||||
padding: 5px 10px;
|
||||
margin: 5px 10px;
|
||||
background-color: transparent;
|
||||
font-weight: normal;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.option-buttons-active {
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #555;
|
||||
}
|
||||
|
||||
.option-buttons:hover {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.option {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -24,7 +42,6 @@ body {
|
|||
border-radius: 3px;
|
||||
box-sizing: border-box;
|
||||
margin-top: 25px;
|
||||
max-width: 470px;
|
||||
padding: 14px 16px;
|
||||
}
|
||||
|
||||
|
@ -40,7 +57,6 @@ body {
|
|||
#notice-locale {
|
||||
background-color: #ffa500;
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.without-checkbox {
|
||||
|
@ -48,6 +64,18 @@ body {
|
|||
padding: 0px !important;
|
||||
}
|
||||
|
||||
#advanced-tab, #export-import-tab, #info-tab {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fonts
|
||||
*/
|
||||
|
@ -114,7 +142,7 @@ body {
|
|||
* Icons
|
||||
*/
|
||||
|
||||
#ruleset-help-icon {
|
||||
.options-help-icon {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
background-image: url("../../icons/info-dark.svg");
|
||||
|
@ -159,6 +187,7 @@ body {
|
|||
background-color: #ea9700;
|
||||
border: 1px solid #d88c00;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.button-warning:hover {
|
||||
|
@ -253,6 +282,10 @@ body {
|
|||
font-style: normal;
|
||||
}
|
||||
|
||||
.storage-type {
|
||||
margin: 5px 0px;
|
||||
}
|
||||
|
||||
.option-disabled > .title-option > .b-contain,
|
||||
.b-contain input[type="checkbox"]:disabled ~ .b-input {
|
||||
cursor: default !important;
|
||||
|
@ -307,9 +340,9 @@ body[dir="rtl"] .input-text {
|
|||
|
||||
.option-group {
|
||||
background-color: #e1e1e1;
|
||||
margin-top: 2rem;
|
||||
padding: .7rem;
|
||||
border-radius: 3px;
|
||||
padding: 1.5rem;
|
||||
border-radius: 5px;
|
||||
margin: 20px 0px;
|
||||
}
|
||||
|
||||
.option-links {
|
||||
|
@ -318,12 +351,19 @@ body[dir="rtl"] .input-text {
|
|||
|
||||
.option-links-div > ul {
|
||||
padding-top: 2rem;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.option-links-div > ul > li {
|
||||
padding-bottom: .5rem;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 500px) {
|
||||
.option-group {
|
||||
padding: 0.7rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #202023;
|
||||
|
|
|
@ -16,171 +16,227 @@
|
|||
<script defer src="../../core/resources.js"></script>
|
||||
<script defer src="../../core/mappings.js"></script>
|
||||
<script src="options.js"></script>
|
||||
<section class="notice notice-warning hidden" id="notice-block-missing">
|
||||
<div class="notice-head">
|
||||
<span data-i18n-content="blockMissingTitle"></span>
|
||||
|
||||
<div class="btn-group">
|
||||
<input type="button" id="btn-general-tab" class="option-buttons option-buttons-active" data-option="general-tab" data-i18n-content="btnGeneral" value="General"/>
|
||||
<input type="button" id="btn-advanced-tab" class="option-buttons" data-option="advanced-tab" data-i18n-content="btnAdvanced" value="Advanced"/>
|
||||
<input type="button" id="btn-export-import-tab" class="option-buttons" data-option="export-import-tab" data-i18n-content="btnOther" value="Other"/>
|
||||
<input type="button" id="btn-info-tab" class="option-buttons" data-option="info-tab" data-i18n-content="btnInfo" value="Info"/>
|
||||
</div>
|
||||
|
||||
<div id="general-tab" class="tab-content">
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="showIconBadge" type="checkbox">
|
||||
<span data-i18n-content="showIconBadgeTitle"></span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="showIconBadgeDescription"></div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="hideReleaseNotes" type="checkbox">
|
||||
<span data-i18n-content="hideReleaseNotesTitle">Disable release notes</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="hideReleaseNotesDescription">If enabled, you wont receive any information about new features in LocalCDN. This includes information about new uBlock/uMatrix rules.</div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="disablePrefetch" type="checkbox">
|
||||
<span data-i18n-content="disablePrefetchTitle"></span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="disablePrefetchDescription"></div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="stripMetadata" type="checkbox">
|
||||
<span data-i18n-content="stripMetadataTitle"></span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="stripMetadataDescription"></div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input id="checkbox-internal-statistics" data-option="internalStatistics" type="checkbox">
|
||||
<span data-i18n-content="internalStatisticsTitle">Internal statistics</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<!-- TODO: Change if test successful -->
|
||||
<div class="description-option" data-i18n-content="internalStatisticsDescription">This function is currently in an experimental stage. No data transmission. It's all local on your device.</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="notice-body" dir="ltr">
|
||||
<div class="notice-message" data-i18n-content="featureBreaksWebsitesDescription">
|
||||
This feature breaks websites. Do not leave it enabled, unless you are prepared to manually whitelist any affected domains.
|
||||
</div>
|
||||
<div class="button button-notice button-warning" id="button-block-missing" data-i18n-content="featureBreaksWebsitesButton">
|
||||
Disable
|
||||
</div>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<div class="title-option without-checkbox" data-i18n-content="whitelistedDomainsTitle"></div>
|
||||
<input id="tf-domains-whitelist" class="input-text without-checkbox" data-option="whitelistedDomains" type="text">
|
||||
<div class="description-option without-checkbox" data-i18n-content="whitelistedDomainsDescription"></div>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="showIconBadge" type="checkbox">
|
||||
<span data-i18n-content="showIconBadgeTitle"></span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="showIconBadgeDescription"></div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="blockMissing" type="checkbox">
|
||||
<span data-i18n-content="blockMissingTitle"></span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
<span class="badge badge-warning" data-i18n-content="advancedLabel"></span>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="blockMissingDescription"></div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="blockGoogleFonts" type="checkbox">
|
||||
<span data-i18n-content="blockGoogleFontsTitle">Block Google Fonts</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</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-whitelist-google-fonts">
|
||||
<div class="description-option" data-i18n-content="labelDomainsWhitelistGoogleFonts">These domains are allowed to load Google Fonts. Separate multiple entries with semi-colons (;).</div>
|
||||
<div class="description-option"><input id="tf-domains-whitelist-google-fonts" class="input-text without-checkbox" data-option="allowedDomainsGoogleFonts" type="text"></div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="disablePrefetch" type="checkbox">
|
||||
<span data-i18n-content="disablePrefetchTitle"></span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
<span class="badge badge-warning" data-i18n-content="advancedLabel"></span>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="disablePrefetchDescription"></div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="stripMetadata" type="checkbox">
|
||||
<span data-i18n-content="stripMetadataTitle"></span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
<span class="badge badge-warning" data-i18n-content="advancedLabel"></span>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="stripMetadataDescription"></div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="enableLogging" type="checkbox">
|
||||
<span data-i18n-content="loggingTitle">Enable logging in browser console</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="loggingDescription">Open "Browser Console" ( CTRL + SHIFT + J ) to show missing resources</div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="hideReleaseNotes" type="checkbox">
|
||||
<span data-i18n-content="hideReleaseNotesTitle">Disable release notes</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
<span class="badge badge-warning" data-i18n-content="advancedLabel"></span>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="hideReleaseNotesDescription">If enabled, you wont receive any information about new features in LocalCDN. This includes information about new uBlock/uMatrix rules.</div>
|
||||
</section>
|
||||
<section id="section-icon-style" class="option">
|
||||
<div class="title-option-select" data-i18n-content="chooseIconStyle">Choose an icon for this extension</div>
|
||||
<div class="description-option">
|
||||
<select id="selected-icon" data-option="selectedIcon">
|
||||
<option value="Default">Default</option>
|
||||
<option value="Light">Light</option>
|
||||
<option value="Grey">Blue/Grey</option>
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input id="checkbox-internal-statistics" data-option="internalStatistics" type="checkbox">
|
||||
<span data-i18n-content="internalStatisticsTitle">Internal statistics</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<!-- TODO: Change if test successful -->
|
||||
<div class="description-option" data-i18n-content="internalStatisticsDescription">This function is currently in an experimental stage. No data transmission. It's all local on your device.</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<div class="title-option without-checkbox" data-i18n-content="whitelistedDomainsTitle"></div>
|
||||
<input id="tf-domains-whitelist" class="input-text without-checkbox" data-option="whitelistedDomains" type="text">
|
||||
<div class="description-option without-checkbox" data-i18n-content="whitelistedDomainsDescription"></div>
|
||||
|
||||
<div id="advanced-tab" class="tab-content">
|
||||
<section class="notice notice-warning hidden" id="notice-block-missing">
|
||||
<div class="notice-head">
|
||||
<span data-i18n-content="blockMissingTitle"></span>
|
||||
</div>
|
||||
<div class="notice-body" dir="ltr">
|
||||
<div class="notice-message" data-i18n-content="featureBreaksWebsitesDescription">
|
||||
This feature breaks websites. Do not leave it enabled, unless you are prepared to manually whitelist any affected domains.
|
||||
</div>
|
||||
<div class="button button-notice button-warning" id="button-block-missing" data-i18n-content="featureBreaksWebsitesButton">
|
||||
Disable
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="blockMissing" type="checkbox">
|
||||
<span data-i18n-content="blockMissingTitle"></span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
<span class="badge badge-warning" data-i18n-content="advancedLabel"></span>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="blockMissingDescription"></div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="blockGoogleFonts" type="checkbox">
|
||||
<span data-i18n-content="blockGoogleFontsTitle">Block Google Fonts</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</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-whitelist-google-fonts">
|
||||
<div class="description-option" data-i18n-content="labelDomainsWhitelistGoogleFonts">These domains are allowed to load Google Fonts. Separate multiple entries with semi-colons (;).</div>
|
||||
<div class="description-option"><input id="tf-domains-whitelist-google-fonts" class="input-text without-checkbox" data-option="allowedDomainsGoogleFonts" type="text"></div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="enableLogging" type="checkbox">
|
||||
<span data-i18n-content="loggingTitle">Enable logging in browser console</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="loggingDescription">Open "Browser Console" ( CTRL + SHIFT + J ) to show missing resources</div>
|
||||
</section>
|
||||
</div>
|
||||
<div id="html-filter-div" class="option-group">
|
||||
<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>
|
||||
<input id="tf-domains-manipulate-dom" class="input-text without-checkbox" data-option="domainsManipulateDOM" type="text">
|
||||
<div class="description-option without-checkbox" data-i18n-content="htmlFilterDomainsDescription">Enter the domains to be handled or ignored by the HTML filter. Separate multiple entries with semi-colons (;).</div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="negateHtmlFilterList" type="checkbox">
|
||||
<span data-i18n-content="negateHtmlFilterListTitle">Invert HTML filter</span>
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
<span class="badge badge-warning" data-i18n-content="advancedLabel"></span>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="negateHtmlFilterListDescription">Enable this option to always apply the HTML filter. The domains in the list will be ignored then. If this option is disabled, the HTML filter is only applied to domains in the list.</div>
|
||||
</section>
|
||||
<a id="negate-html-filter-list-warning" data-i18n-content="negateHtmlFilterListWarning">This function can break websites. Please note the information on the Wiki page.</a>
|
||||
</div>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<div class="title-option without-checkbox"><span data-i18n-content="generateRuleSetTitle">Generate rule set</span><span id="ruleset-help" class="options-help-icon"></span></div>
|
||||
<div class="description-option without-checkbox">
|
||||
<p class="without-checkbox" data-i18n-content="generateRuleSetDescription">In case you're using uBlock Origin or uMatrix you can generate the rules here. You have to add these rules manually in uBlock Origin or uMatrix.</p>
|
||||
</div>
|
||||
<div class="ruleset-generator">
|
||||
<p id="last-mapping-update" class="description-option last-update without-checkbox" data-i18n-content="lastUpdate">Last update:</p>
|
||||
</div>
|
||||
<div class="ruleset-generator">
|
||||
<label class="b-contain" for="generate-ublock-rules">uBlock
|
||||
<input id="generate-ublock-rules" name="rule-sets" data-option="uBlock" type="radio" value="uBlock">
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="ruleset-generator">
|
||||
<label class="b-contain" for="generate-umatrix-rules">uMatrix
|
||||
<input id="generate-umatrix-rules" name="rule-sets" data-option="uMatrix" type="radio" value="uMatrix">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div id="html-filter-div" class="option-group">
|
||||
<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>
|
||||
<input id="tf-domains-manipulate-dom" class="input-text without-checkbox" data-option="domainsManipulateDOM" type="text">
|
||||
<div class="description-option without-checkbox" data-i18n-content="htmlFilterDomainsDescription">Enter the domains to be handled or ignored by the HTML filter. Separate multiple entries with semi-colons (;).</div>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option">
|
||||
<label class="b-contain">
|
||||
<input data-option="negateHtmlFilterList" type="checkbox">
|
||||
<span data-i18n-content="negateHtmlFilterListTitle">Invert HTML filter</span>
|
||||
|
||||
<div id="export-import-tab" class="tab-content">
|
||||
<div id="icon-style-div" class="option-group">
|
||||
<section id="section-icon-style" class="option">
|
||||
<div class="title-option without-checkbox" data-i18n-content="chooseIconStyle">Choose an icon for this extension</div>
|
||||
<div>
|
||||
<select id="selected-icon" data-option="selectedIcon">
|
||||
<option value="Default">Default</option>
|
||||
<option value="Light">Light</option>
|
||||
<option value="Grey">Blue/Grey</option>
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<div class="title-option without-checkbox"><span data-i18n-content="headerStorageType">Storage type</span><span id="sync-help" class="options-help-icon"></span></div>
|
||||
<label class="b-contain storage-type" for="storage-type-local"><span data-i18n-content="labelStorageTypeLocal">Local (recommended)</span>
|
||||
<input id="storage-type-local" name="storage-type" data-option="storageTypeLocal" type="radio" value="local">
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
<span class="badge badge-warning" data-i18n-content="advancedLabel"></span>
|
||||
</div>
|
||||
<div class="description-option" data-i18n-content="negateHtmlFilterListDescription">Enable this option to always apply the HTML filter. The domains in the list will be ignored then. If this option is disabled, the HTML filter is only applied to domains in the list.</div>
|
||||
</section>
|
||||
<a id="negate-html-filter-list-warning" data-i18n-content="negateHtmlFilterListWarning">This function can break websites. Please note the information on the Wiki page.</a>
|
||||
<label class="b-contain storage-type" for="storage-type-sync"><span data-i18n-content="labelStorageTypeSync">Sync</span>
|
||||
<input id="storage-type-sync" name="storage-type" data-option="storageTypeSync" type="radio" value="sync">
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</section>
|
||||
<section class="option">
|
||||
<div class="title-option without-checkbox" data-i18n-content="headerImportExport">Import/Export</div>
|
||||
<div class="import-export">
|
||||
<input type="button" id="import-data" value="Import Data" data-i18n-content="labelImportData"/>
|
||||
<input type="button" id="export-data" value="Export Data" data-i18n-content="labelExportData"/>
|
||||
<div class="hidden">
|
||||
<input id="import-file-picker" type="file" accept="text/plain">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="option-group">
|
||||
<section class="option">
|
||||
<div class="title-option without-checkbox"><span data-i18n-content="generateRuleSetTitle">Generate rule set</span><span id="ruleset-help-icon"></span></div>
|
||||
<div class="description-option without-checkbox">
|
||||
<p class="without-checkbox" data-i18n-content="generateRuleSetDescription">In case you're using uBlock Origin or uMatrix you can generate the rules here. You have to add these rules manually in uBlock Origin or uMatrix.</p>
|
||||
</div>
|
||||
<div class="ruleset-generator">
|
||||
<p id="last-mapping-update" class="description-option last-update without-checkbox" data-i18n-content="lastUpdate">Last update:</p>
|
||||
</div>
|
||||
<div class="ruleset-generator">
|
||||
<label class="b-contain" for="generate-ublock-rules">uBlock
|
||||
<input id="generate-ublock-rules" name="rule-sets" data-option="uBlock" type="radio" value="uBlock">
|
||||
<div class="b-input"></div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="ruleset-generator">
|
||||
<label class="b-contain" for="generate-umatrix-rules">uMatrix
|
||||
<input id="generate-umatrix-rules" name="rule-sets" data-option="uMatrix" type="radio" value="uMatrix">
|
||||
<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>
|
||||
|
||||
<div id="info-tab" class="tab-content">
|
||||
<div class="option-links-div option-group">
|
||||
<ul class="option-links">
|
||||
<li><a id="link-welcome-page" class="no-icon">Welcome page (In-App)</a></li>
|
||||
<li><a id="link-changelog" class="no-icon">Changelog (In-App)</a></li>
|
||||
<li><a id="link-donate" class="no-icon">Donate (In-App)</a></li>
|
||||
<li><a id="link-faq" class="no-icon">FAQ (In-App)</a></li>
|
||||
<li><a id="link-statistic" class="no-icon"><span data-i18n-content="internalStatisticsTitle">Statistics</span> <span>(In-App)</span></a></li><br>
|
||||
<li><a id="link-codeberg" href="https://codeberg.org/nobody/LocalCDN" target="_blank" rel="nofollow noopener noreferrer">Source (www.codeberg.org)</a></li>
|
||||
<li><a id="link-website" href="https://www.localcdn.org" target="_blank" rel="nofollow noopener noreferrer">Website (www.localcdn.org)</a></li>
|
||||
<li><a id="link-website-test" href="https://www.localcdn.org/test" target="_blank" rel="nofollow noopener noreferrer">Testing Utility (www.localcdn.org/test)</a></li>
|
||||
<li><a id="link-translate" href="https://hosted.weblate.org/projects/localcdn/localcdn/" target="_blank" rel="nofollow noopener noreferrer">Translate (www.weblate.org)</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<section class="notice notice-default hidden" id="notice-locale">
|
||||
<div class="notice-body" dir="ltr">
|
||||
|
@ -192,18 +248,6 @@
|
|||
</a>
|
||||
</div>
|
||||
</section>
|
||||
<div class="option-links-div">
|
||||
<ul class="option-links">
|
||||
<li><a id="link-welcome-page" class="no-icon">Welcome page (In-App)</a></li>
|
||||
<li><a id="link-changelog" class="no-icon">Changelog (In-App)</a></li>
|
||||
<li><a id="link-donate" class="no-icon">Donate (In-App)</a></li>
|
||||
<li><a id="link-faq" class="no-icon">FAQ (In-App)</a></li>
|
||||
<li><a id="link-statistic" class="no-icon"><span data-i18n-content="internalStatisticsTitle">Statistics</span> <span>(In-App)</span></a></li><br>
|
||||
<li><a id="link-codeberg" href="https://codeberg.org/nobody/LocalCDN" target="_blank" rel="nofollow noopener noreferrer">Source (www.codeberg.org)</a></li>
|
||||
<li><a id="link-website" href="https://www.localcdn.org" target="_blank" rel="nofollow noopener noreferrer">Website (www.localcdn.org)</a></li>
|
||||
<li><a id="link-website-test" href="https://www.localcdn.org/test" target="_blank" rel="nofollow noopener noreferrer">Testing Utility (www.localcdn.org/test)</a></li>
|
||||
<li><a id="link-translate" href="https://hosted.weblate.org/projects/localcdn/localcdn/" target="_blank" rel="nofollow noopener noreferrer">Translate (www.weblate.org)</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p class="footer">LocalCDN v<span id="label-version"></span></p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -45,8 +45,9 @@ options._renderContents = function () {
|
|||
}
|
||||
|
||||
if (!chrome.browserAction.setIcon) {
|
||||
document.getElementById('section-icon-style').style.display = 'none';
|
||||
document.getElementById('icon-style-div').style.display = 'none';
|
||||
}
|
||||
document.getElementById('label-version').textContent = helpers.formatVersion(chrome.runtime.getManifest().version);
|
||||
};
|
||||
|
||||
options._renderOptionsPanel = function () {
|
||||
|
@ -98,16 +99,32 @@ options._renderOptionsPanel = function () {
|
|||
document.getElementById('div-domains-whitelist-google-fonts').style.display = 'none';
|
||||
}
|
||||
|
||||
if (elements.storageType === 'local') {
|
||||
document.getElementById('storage-type-local').checked = true;
|
||||
} else {
|
||||
document.getElementById('storage-type-sync').checked = true;
|
||||
}
|
||||
|
||||
document.getElementById('last-mapping-update').textContent += ' ' + lastMappingUpdate;
|
||||
document.getElementById('negate-html-filter-list-warning').addEventListener('click', options._onClickHTMLFilterWarning);
|
||||
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);
|
||||
document.getElementById('link-faq').addEventListener('click', options._onClickFaq);
|
||||
document.getElementById('ruleset-help-icon').addEventListener('click', options._onClickRulesetHelp);
|
||||
document.getElementById('link-statistic').addEventListener('click', options._onClickStatistics);
|
||||
document.getElementById('negate-html-filter-list-warning').addEventListener('click', function () { options._onLinkClick(Links.CODEBERG_HTML_FILTER); });
|
||||
document.getElementById('link-welcome-page').addEventListener('click', function () { options._onLinkClick(Links.WELCOME); });
|
||||
document.getElementById('link-changelog').addEventListener('click', function () { options._onLinkClick(Links.CHANGELOG); });
|
||||
document.getElementById('link-donate').addEventListener('click', function () { options._onLinkClick(Links.DONATE); });
|
||||
document.getElementById('link-faq').addEventListener('click', function () { options._onLinkClick(Links.FAQ);});
|
||||
document.getElementById('ruleset-help').addEventListener('click', function () { options._onLinkClick(Links.CODEBERG_RULESET); });
|
||||
document.getElementById('sync-help').addEventListener('click', function () { options._onLinkClick(Links.FAQ + '#sync'); });
|
||||
document.getElementById('link-statistic').addEventListener('click', function () { options._onLinkClick(Links.STATISTICS); });
|
||||
|
||||
document.getElementById('btn-general-tab').addEventListener('click', options._changeTab);
|
||||
document.getElementById('btn-advanced-tab').addEventListener('click', options._changeTab);
|
||||
document.getElementById('btn-export-import-tab').addEventListener('click', options._changeTab);
|
||||
document.getElementById('btn-info-tab').addEventListener('click', options._changeTab);
|
||||
|
||||
document.getElementById('storage-type-local').addEventListener('change', options._onStorageOptionChanged);
|
||||
document.getElementById('storage-type-sync').addEventListener('change', options._onStorageOptionChanged);
|
||||
document.getElementById('export-data').addEventListener('click', storageManager.export);
|
||||
document.getElementById('import-data').addEventListener('click', storageManager.startImportFilePicker);
|
||||
document.getElementById('import-file-picker').addEventListener('change', storageManager.handleImportFilePicker);
|
||||
};
|
||||
|
||||
options._renderBlockMissingNotice = function () {
|
||||
|
@ -199,7 +216,6 @@ options._getOptionElements = function () {
|
|||
[Setting.ALLOWED_DOMAINS_GOOGLE_FONTS]: options._getOptionElement(Setting.ALLOWED_DOMAINS_GOOGLE_FONTS),
|
||||
[Setting.STORAGE_TYPE]: options._getOptionElement(Setting.STORAGE_TYPE)
|
||||
};
|
||||
|
||||
return optionElements;
|
||||
};
|
||||
|
||||
|
@ -316,53 +332,29 @@ options._onStorageOptionChanged = function ({ target }) {
|
|||
});
|
||||
};
|
||||
|
||||
options._onClickHTMLFilterWarning = function () {
|
||||
options._onLinkClick = function (url) {
|
||||
chrome.tabs.create({
|
||||
url: 'https://codeberg.org/nobody/LocalCDN/wiki/Blank-websites-or-weird-characters',
|
||||
active: true,
|
||||
url: url,
|
||||
active: true
|
||||
});
|
||||
};
|
||||
|
||||
options._onClickWelcomePage = function () {
|
||||
chrome.tabs.create({
|
||||
url: chrome.extension.getURL('pages/welcome/welcome.html'),
|
||||
active: true,
|
||||
});
|
||||
};
|
||||
options._changeTab = function ({ target }) {
|
||||
let tabContent, tabButton, optionKey;
|
||||
|
||||
options._onClickDonate = function () {
|
||||
chrome.tabs.create({
|
||||
url: chrome.extension.getURL('pages/donate/donate.html'),
|
||||
active: true,
|
||||
});
|
||||
};
|
||||
optionKey = target.getAttribute('data-option');
|
||||
tabContent = document.getElementsByClassName('tab-content');
|
||||
tabButton = document.getElementsByClassName('option-buttons');
|
||||
|
||||
options._onClickChangelog = function () {
|
||||
chrome.tabs.create({
|
||||
url: chrome.extension.getURL('pages/updates/updates.html'),
|
||||
active: true,
|
||||
});
|
||||
};
|
||||
|
||||
options._onClickFaq = function () {
|
||||
chrome.tabs.create({
|
||||
url: chrome.extension.getURL('pages/help/help.html'),
|
||||
active: true,
|
||||
});
|
||||
};
|
||||
|
||||
options._onClickRulesetHelp = function () {
|
||||
chrome.tabs.create({
|
||||
url: 'https://codeberg.org/nobody/LocalCDN/wiki/Ruleset-generator-for-uBlock-Origin-or-uMatrix',
|
||||
active: true,
|
||||
});
|
||||
};
|
||||
|
||||
options._onClickStatistics = function () {
|
||||
chrome.tabs.create({
|
||||
url: chrome.extension.getURL('pages/statistics/statistics.html'),
|
||||
active: true,
|
||||
});
|
||||
for (let i = 0; i < tabContent.length; i++) {
|
||||
if (tabContent[i].id === optionKey) {
|
||||
tabContent[i].style.display = 'block';
|
||||
tabButton[i].classList.add('option-buttons-active');
|
||||
} else {
|
||||
tabContent[i].style.display = 'none';
|
||||
tabButton[i].classList.remove('option-buttons-active');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
<li>Added: Bootstrap Toggle v2.2.2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/90">#90</a>)</li>
|
||||
<li>Implemented: Open options in new tab (<a href="https://codeberg.org/nobody/LocalCDN/issues/91">#91</a>)</li>
|
||||
<li>Implemented: Storage handler (<a href="https://codeberg.org/nobody/LocalCDN/issues/92">#92</a>)</li>
|
||||
<li>Updated: Options page (<a href="https://codeberg.org/nobody/LocalCDN/issues/93">#93</a>)</li>
|
||||
<li>Updated: Google Material Icons (<a href="https://codeberg.org/nobody/LocalCDN/issues/94">#94</a>)</li>
|
||||
<li>Added: P2P Media Loader Hls.js (v0.6.2) (<a href="https://codeberg.org/nobody/LocalCDN/issues/95">#95</a>)</li>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue