Skip to content

getEnableScript 优化#645

Merged
CodFrm merged 4 commits intoscriptscat:mainfrom
cyfung1031:fix20250820b
Aug 20, 2025
Merged

getEnableScript 优化#645
CodFrm merged 4 commits intoscriptscat:mainfrom
cyfung1031:fix20250820b

Conversation

@cyfung1031
Copy link
Copy Markdown
Collaborator

No description provided.

@cyfung1031
Copy link
Copy Markdown
Collaborator Author

不可以,这里需要以主窗口的配置 `enable_script` 优先,如果修改成 

```js
`enable_script${chrome.extension.inIncognitoContext ? "_incognito" : ""}`
```

当主窗口关闭的情况下,这个是无效的

_Originally posted by @CodFrm in https://github.com/scriptscat/scriptcat/issues/642#issuecomment-3204666230_

不能只追蹤 enable_script_incognito
還要追蹤 enable_script

當 enable_script 變成 false 時,isLoadScripts要改為 false

@CodFrm CodFrm merged commit 04910cf into scriptscat:main Aug 20, 2025
3 checks passed
cyfung1031 added a commit to cyfung1031/scriptcat that referenced this pull request Aug 20, 2025
* runtime.ts 代码优化

* 优化

* getEnableScript 优化
CodFrm added a commit that referenced this pull request Aug 23, 2025
* 重写UrlMatch

* 整理代码

* 添加单元测试

* 兼容 .tld

* 修正 match pattern ** 问题

* 代码及测试修正

* 补充单元测试

* 调整单元测试

* 将单元测试url换成更实际的url

* 修改单元测试

* 修改01

* file应该是三个斜杠

* 修正02

* 修正03

* 修正04

* add -> addInclude

* customUrlCovering -> customMUP

* urlCovering -> scriptMUP

* metaUMatchAnalyze -> extractMUP

* 修正05

* lint fix

* 注释修正

* 注释修正

* 内部测试补充

* glob *? -> ?*

* 單元測試 glob-test-3

* 修正06

* MUP -> UrlPatterns

* 修正07

* 加注释:GM 的 magic tld 说明

* glob * 修正

* 代码优化,注释补充

* 修正特殊處理,修正單元測試

* Update match.test.ts

* 处理lint问题

* 代码优化

* lint

* sorter 相关代码优化

* 变数名统一 strBlacklist

* 修正 regex pattern 没有匹配到页面问题

* wildcard處理

* lint

* 注釋修正

* 把glob的指定网域取出来

* 效能修正

* 处理review问题

* 单元测试优化,加强错误处理

* 改进代码处理

* lint

* extractSchemesOfGlobs, 单元测试调整

* ⚡ runtime.ts 代码优化 (#642)

* runtime.ts 代码优化

* 优化

* 🎨 getEnableScript 优化 (#645)

* runtime.ts 代码优化

* 优化

* getEnableScript 优化

* lint

* 誤字

* 加注釋

* lint

* 微调 regex pattern ruleContent

* RuleType

* 增加单元测试 (extractMatchPatternsFromGlobs, extractSchemesOfGlobs)

* 配合使用情景,增强 regexToGlob处理

* vitest 测试顺序

* url_matcher.test.js -> url_matcher.test.ts

* 🐛 兼容较低的浏览器内核 #647

* 移除 vitest 测试顺序

* 增强 regexToGlob处理

* 刪去不必要code

* 单元测试調整

* 单元测试調整

* regexToGlob 规范化连续 修正

* 刪去不必要code

* 補充注釋

---------

Co-authored-by: 王一之 <yz@ggnb.top>
@cyfung1031 cyfung1031 deleted the fix20250820b branch October 4, 2025 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants