diff --git a/extension-v2/js/background-advance.js b/extension-v2/js/background-advance.js index 0c33c206..dadd2b7e 100644 --- a/extension-v2/js/background-advance.js +++ b/extension-v2/js/background-advance.js @@ -11,7 +11,7 @@ const tabinfo = new Map(); */ function hasCSP(headers = []) { return headers.some( - (x) => x.name.toLowerCase() === "content-security-policy", + (x) => x.name.toLowerCase() === "content-security-policy" ); } @@ -134,7 +134,7 @@ chrome.webRequest.onHeadersReceived.addListener( //移除响应头 Content-Security-Policy details.responseHeaders = details.responseHeaders.filter( (response_header) => - !remove_csp_item.includes(response_header.name.toLowerCase()), + !remove_csp_item.includes(response_header.name.toLowerCase()) ); /* @@ -154,7 +154,7 @@ chrome.webRequest.onHeadersReceived.addListener( ], types: web_request_resource_types, }, - ["blocking", "responseHeaders"], + ["blocking", "responseHeaders"] ); /* @@ -193,7 +193,7 @@ let need_replace_cdn_urls = [ "www.gravatar.com", "maxcdn.bootstrapcdn.com", "github.com", - "www.google.com", + "www.google.com" ]; let cdn_urls = need_replace_cdn_urls.map((currentValue, index, arr) => { @@ -218,7 +218,7 @@ let opensource_google_urls = [ "*://summerofcode.withgoogle.com/*", "*://cs.opensource.google/*", //Google Open Source "*://opensource.googleblog.com/*", - "*://opensource.google/*", + "*://opensource.google/*" ]; // 高级玩法测试域名组 @@ -315,7 +315,7 @@ chrome.webRequest.onBeforeRequest.addListener( url = url.replace("fonts.gstatic.com", "fonts.gstatic.cn"); url = url.replace( "www.google.com/recaptcha/", - "www.recaptcha.net/recaptcha/", + "www.recaptcha.net/recaptcha/" ); url = url.replace("secure.gravatar.com", "gravatar.loli.net"); url = url.replace("www.gravatar.com", "gravatar.loli.net"); @@ -328,15 +328,15 @@ chrome.webRequest.onBeforeRequest.addListener( //"cdn.jsdelivr.net/npm/bootstrap@$1/dist/$2" url = url.replace( /maxcdn\.bootstrapcdn\.com\/bootstrap\/(\d{1,4}\.\d{1,4}\.\d{1,4})\/(.*?)/g, - "lib.baomitu.com/twitter-bootstrap/$1/$2", + "lib.baomitu.com/twitter-bootstrap/$1/$2" ); url = url.replace( /code\.jquery\.com\/jquery-(\d{1,4}\.\d{1,4}\.\d{1,4})(.*?)/g, - "lib.baomitu.com/jquery/$1/jquery$2", + "lib.baomitu.com/jquery/$1/jquery$2" ); url = url.replace( /code\.jquery\.com\/ui\/(\d{1,4}\.\d{1,4}\.\d{1,4})\/(.*?)/g, - "ajax.aspnetcdn.com/ajax/jquery.ui/$1/$2", + "ajax.aspnetcdn.com/ajax/jquery.ui/$1/$2" ); url = url.replace("developers.google.com", "developers.google.cn"); url = url.replace("developer.android.com", "developer.android.google.cn"); @@ -367,7 +367,7 @@ chrome.webRequest.onBeforeRequest.addListener( ...block_domain_urls, //阻止域名请求 ], }, - ["blocking"], + ["blocking"] ); /* @@ -470,7 +470,7 @@ chrome.webRequest.onBeforeSendHeaders.addListener( "*://example-example.com/*", ], }, - ["blocking", "requestHeaders"], + ["blocking", "requestHeaders"] //["blocking", "requestHeaders", "extraHeaders"] ); diff --git a/extension-v2/js/background.js b/extension-v2/js/background.js index 66c6e403..f7cb64ef 100644 --- a/extension-v2/js/background.js +++ b/extension-v2/js/background.js @@ -19,7 +19,7 @@ const remove_csp_item = [ "cross-origin-embedder-policy", "cross-origin-opener-policy", "cross-origin-opener-policy-report-only", - "cross-origin-embedder-policy-report-only", + "cross-origin-embedder-policy-report-only" ]; /** @@ -42,7 +42,7 @@ const remove_csp_urls = [ "*://developers.redhat.com/*", "*://*.githubusercontent.com/*", "*://pub.dev/*", - "*://stackoverflow.com/*", + "*://stackoverflow.com/*" ]; /** @@ -54,7 +54,7 @@ chrome.webRequest.onHeadersReceived.addListener( //移除响应头 Content-Security-Policy details.responseHeaders = details.responseHeaders.filter( (response_header) => - !remove_csp_item.includes(response_header.name.toLowerCase()), + !remove_csp_item.includes(response_header.name.toLowerCase()) ); return { responseHeaders: details.responseHeaders, @@ -78,7 +78,7 @@ chrome.webRequest.onHeadersReceived.addListener( "other", ], }, - ["blocking", "responseHeaders"], + ["blocking", "responseHeaders"] ); /* @@ -96,7 +96,7 @@ chrome.webRequest.onBeforeRequest.addListener( url = url.replace("fonts.gstatic.com", "fonts.gstatic.cn"); url = url.replace( "www.google.com/recaptcha/", - "www.recaptcha.net/recaptcha/", + "www.recaptcha.net/recaptcha/" ); url = url.replace("secure.gravatar.com", "gravatar.loli.net"); url = url.replace("www.gravatar.com", "gravatar.loli.net"); @@ -108,15 +108,15 @@ chrome.webRequest.onBeforeRequest.addListener( //"cdn.jsdelivr.net/npm/bootstrap@$1/dist/$2" url = url.replace( /maxcdn\.bootstrapcdn\.com\/bootstrap\/(\d{1,4}\.\d{1,4}\.\d{1,4})\/(.*?)/g, - "lib.baomitu.com/twitter-bootstrap/$1/$2", + "lib.baomitu.com/twitter-bootstrap/$1/$2" ); url = url.replace( /code\.jquery\.com\/jquery-(\d{1,4}\.\d{1,4}\.\d{1,4})(.*?)/g, - "lib.baomitu.com/jquery/$1/jquery$2", + "lib.baomitu.com/jquery/$1/jquery$2" ); url = url.replace( /code\.jquery\.com\/ui\/(\d{1,4}\.\d{1,4}\.\d{1,4})\/(.*?)/g, - "ajax.aspnetcdn.com/ajax/jquery.ui/$1/$2", + "ajax.aspnetcdn.com/ajax/jquery.ui/$1/$2" ); return { redirectUrl: url }; }, @@ -137,5 +137,5 @@ chrome.webRequest.onBeforeRequest.addListener( "*://code.jquery.com/ui/*", ], }, - ["blocking"], + ["blocking"] ); diff --git a/extension/options_ui/README.md b/extension/options_ui/README.md index ac13584a..9f045f6c 100644 --- a/extension/options_ui/README.md +++ b/extension/options_ui/README.md @@ -70,7 +70,7 @@ chrome.declarativeNetRequest.updateDynamicRules( }, (parameter) => { console.log(parameter); - }, + } ); ``` diff --git a/extension/options_ui/js/AdvanceBundle/Components/globalDynamicRuleMain.js b/extension/options_ui/js/AdvanceBundle/Components/globalDynamicRuleMain.js index 0ca874ed..1005e068 100644 --- a/extension/options_ui/js/AdvanceBundle/Components/globalDynamicRuleMain.js +++ b/extension/options_ui/js/AdvanceBundle/Components/globalDynamicRuleMain.js @@ -96,7 +96,7 @@ let bindSyncRemoteStaticRuleEventListener = () => { UpdateRulesetOptions, (callback) => { showRuleList(); - }, + } ); }); } diff --git a/extension/options_ui/js/AdvanceBundle/Components/selfDefineRule.js b/extension/options_ui/js/AdvanceBundle/Components/selfDefineRule.js index f2f30088..adc034c0 100644 --- a/extension/options_ui/js/AdvanceBundle/Components/selfDefineRule.js +++ b/extension/options_ui/js/AdvanceBundle/Components/selfDefineRule.js @@ -137,7 +137,7 @@ let bindButtonUploadRuleFromFile = () => { e.stopPropagation(); e.preventDefault(); }, - false, + false ); dropbox.addEventListener( "dragover", @@ -145,7 +145,7 @@ let bindButtonUploadRuleFromFile = () => { e.stopPropagation(); e.preventDefault(); }, - false, + false ); dropbox.addEventListener( @@ -166,7 +166,7 @@ let bindButtonUploadRuleFromFile = () => { showUploadFileContent(file); } }, - false, + false ); }; diff --git a/extension/options_ui/js/AdvanceBundle/Controller/advanceController.js b/extension/options_ui/js/AdvanceBundle/Controller/advanceController.js index 6e90e41d..05d2454f 100644 --- a/extension/options_ui/js/AdvanceBundle/Controller/advanceController.js +++ b/extension/options_ui/js/AdvanceBundle/Controller/advanceController.js @@ -27,7 +27,7 @@ let messageReciver = () => { } } }, - false, + false ); }; diff --git a/extension/options_ui/js/CommonBundle/Components/common.js b/extension/options_ui/js/CommonBundle/Components/common.js index e57d35a3..f7c7cea6 100644 --- a/extension/options_ui/js/CommonBundle/Components/common.js +++ b/extension/options_ui/js/CommonBundle/Components/common.js @@ -39,7 +39,7 @@ let updateDynamicRules = ( }, () => { callback(args); - }, + } ); }; let deleteDynamicRules = (type, id = 0, callback = () => {}, ...args) => { @@ -82,7 +82,7 @@ let deleteDynamicRules = (type, id = 0, callback = () => {}, ...args) => { }, () => { callback(args); - }, + } ); } }); @@ -128,7 +128,7 @@ let enableStaticRules = (callback, ...args) => { deleteDynamicRules("sync_remote_static_rule", 0, () => { callback(); }); - }, + } ); }; diff --git a/extension/options_ui/js/CommonBundle/Components/editor.js b/extension/options_ui/js/CommonBundle/Components/editor.js index 87de8ab4..464f27a6 100644 --- a/extension/options_ui/js/CommonBundle/Components/editor.js +++ b/extension/options_ui/js/CommonBundle/Components/editor.js @@ -10,7 +10,7 @@ let editor = { onChange: ( updatedContent, previousContent, - { contentErrors, patchResult }, + { contentErrors, patchResult } ) => { // content is an object { json: JSONData } | { text: string } /* diff --git a/extension/options_ui/js/CommonBundle/Components/showDynamicRules.js b/extension/options_ui/js/CommonBundle/Components/showDynamicRules.js index 1321e8e8..52024473 100644 --- a/extension/options_ui/js/CommonBundle/Components/showDynamicRules.js +++ b/extension/options_ui/js/CommonBundle/Components/showDynamicRules.js @@ -39,7 +39,7 @@ let showDynamicRules = (type = "all_dynamic_rule") => { list += `