Added CDN: fonts.gstatic.com (#269)

This commit is contained in:
nobody 2021-02-10 06:36:01 +01:00
parent ee0d337c91
commit 8bb6d5fa61
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
4 changed files with 9 additions and 4 deletions

View File

@ -194,7 +194,7 @@ const IconType = {
};
const Regex = {
'GOOGLE_FONTS': /fonts\.googleapis\.com\/(css|icons)(?!.*Material\+Icons).*/,
'GOOGLE_FONTS': /fonts\.(googleapis|gstatic)\.com\/.*/,
'GOOGLE_MATERIAL_ICONS': /fonts\.googleapis\.com\/(icon|css)\?family=.*Material\+Icons/,
'JSDELIVR_COMBINE': /cdn\.jsdelivr\.net.*\/combine.*jquery.*hogan.*algoliasearch.*autocomplete.*/,
'BOOTSTRAP_DATEPICKER_3': /\/bootstrap-datepicker3.*\.css/,
@ -254,6 +254,7 @@ const CDNs = {
const IgnoredHost = {
'fonts.googleapis.com': true,
'fonts.gstatic.com': true,
};
// Supported charsets for TextDecoder()

View File

@ -117,8 +117,8 @@ interceptor._handleStorageChanged = function (changes) {
interceptor.blockGoogleFonts = changes.blockGoogleFonts.newValue;
}
if (Setting.BLOCK_GOOGLE_FONTS in changes) {
interceptor.blockGoogleFonts = changes.blockGoogleFonts.newValue;
if (Setting.ALLOWED_DOMAINS_GOOGLE_FONTS in changes) {
interceptor.allowedDomainsGoogleFonts = changes.allowedDomainsGoogleFonts.newValue;
}
};

View File

@ -29,7 +29,7 @@ var mappings = {};
* This only needs to be updated when new domains are added.
* It's not necessary for subdirectories!
*/
mappings.lastMappingUpdate = '2020-12-30';
mappings.lastMappingUpdate = '2021-02-10';
mappings.cdn = {
@ -994,3 +994,6 @@ mappings.cdn['lib.baomitu.com'] = {
// Boot CDN New [Mirror]
mappings.cdn['cdn.bootcdn.net'] = mappings.cdn['cdnjs.cloudflare.com'];
// CDN for the "Block Google Fonts" option (see: https://codeberg.org/nobody/LocalCDN/issues/269)
mappings.cdn['fonts.gstatic.com'] = mappings.cdn['fonts.googleapis.com'];

View File

@ -32,6 +32,7 @@
<li>Updated: Google Material Icons v76 -> v77 (<a href="https://codeberg.org/nobody/LocalCDN/issues/267">#267</a>)</li>
<li>Updated: ember.js v3.24.1 -> v3.25.0 (<a href="https://codeberg.org/nobody/LocalCDN/issues/268">#268</a>)</li>
<li>Updated: instantsearch.js v4.13.2 -> v4.14.0 (<a href="https://codeberg.org/nobody/LocalCDN/issues/270">#270</a>)</li>
<li>Added CDN: fonts.gstatic.com (<a href="https://codeberg.org/nobody/LocalCDN/issues/269">#269</a>)</li>
</ul>
<div id="generator-section">
<div class="topic-label">