更完整的permission检查,更好的userScript权限提示#1251
Open
cyfung1031 wants to merge 1 commit intoscriptscat:release/v1.3from
Open
更完整的permission检查,更好的userScript权限提示#1251cyfung1031 wants to merge 1 commit intoscriptscat:release/v1.3from
cyfung1031 wants to merge 1 commit intoscriptscat:release/v1.3from
Conversation
Collaborator
cyfung1031
commented
Feb 15, 2026
- BrowserType的写法改了。那些ChormeA ChromeB ChromeC ... 不是做这个的原意。我们直接用 bitFlag写清楚用途就可以。还有是由低版本至高版本。
- Permission Check. 如果直接检查不存在于 optional 的 permission, Firefox会直接报错。所以就引入 isPermissionOK 出了解这个 permission 是不是 ok. 如果是 false 的话,可以进行要求。报错就是 null
- 现在有个首次警告弹出的设计。但没考虑到浏览器升级会改specification. 例如最近的Edge升级。未来也可能会再二度三度改变。当版本升级时,也要当是首次
- 因为BrowserType有足够的资讯,也知道是devModeOpen还是allowScript,SC可以直接打开更直接的引导画面。
8736b73 to
cdfb48f
Compare
Member
|
之前做这里的时候,我本来想重构的,但是一般是不喜欢做很大的改动,改好了又撤回了 这种位的操作阅读性也不好,本来是修改成 getBrowserType 只获取浏览器的信息,通过另外的函数去判断类型 既然又提到这里了,我晚点按我的想法重构一下,你再看看 |
Collaborator
Author
用位操作主要是方便一个物件储存大量 true/false 讯息啦 尝试接受吧 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.