File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
src/app/service/service_worker Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -151,32 +151,28 @@ export class ScriptService {
151151 // 兼容 chrome 内核 < 128 处理
152152 const condition : chrome . declarativeNetRequest . RuleCondition = {
153153 regexFilter : "^[^#]+\\.user(\\.bg|\\.sub)?\\.js(\\?.*?)?$" ,
154- resourceTypes : [
155- chrome . declarativeNetRequest . ResourceType . MAIN_FRAME ,
156- chrome . declarativeNetRequest . ResourceType . OTHER ,
157- chrome . declarativeNetRequest . ResourceType . CSP_REPORT ,
158- ] ,
154+ resourceTypes : [ chrome . declarativeNetRequest . ResourceType . MAIN_FRAME ] ,
159155 requestMethods : [ "get" as chrome . declarativeNetRequest . RequestMethod ] ,
160156 responseHeaders : [
161157 {
162158 header : "Content-Type" ,
163159 values : [
164- "text/javascript" ,
165- "application/javascript" ,
166- "text/plain" ,
167- "application/octet-stream" ,
168- "application/force-download" ,
160+ "text/javascript*" ,
161+ "application/javascript*" ,
162+ "text/html*" ,
163+ "text/plain*" ,
164+ "application/octet-stream*" ,
165+ "application/force-download*" ,
169166 ] ,
170167 } ,
171168 ] ,
172169 isUrlFilterCaseSensitive : true ,
173- excludedTabIds : [ chrome . tabs . TAB_ID_NONE ] ,
174170 } ;
175171 const installPageURL = chrome . runtime . getURL ( "src/install.html" ) ;
176172 // 重定向到脚本安装页
177173 chrome . declarativeNetRequest . updateDynamicRules (
178174 {
179- removeRuleIds : [ 1 , 2 ] ,
175+ removeRuleIds : [ 1 ] ,
180176 addRules : [
181177 {
182178 id : 1 ,
You can’t perform that action at this time.
0 commit comments