🐛 修复 Firefox 中 GM_cookie 无法获取 cookie 的问题#1319
Merged
CodFrm merged 14 commits intorelease/mv2from Mar 28, 2026
Merged
Conversation
Collaborator
|
这么突然把 Firefox 版搞起来? |
# Conflicts: # src/app/message/common.ts
Member
Author
主要是有人反馈了安全漏洞,然后顺便修一下 |
Member
Author
|
好像有点问题,firefox处理不了cookie,我不记得是什么原因去了 |
Collaborator
? 不是加了 firstPartyDomain 就行了吗 MV3那边有重构过 GM_cookie 这个东西 ( methodInject 那个, 能够一层一层注入 ) 所以可以正确实现 |
Member
Author
哦哦,搞错了,是我测试脚本的问题 |
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.
Checklist / 检查清单
Description / 描述
fix #1187
Firefox 中
GM_cookie.list无法获取 cookie,原因有两个:undefined属性传递差异:chrome.cookies.getAll()调用时传入了值为undefined的属性(如domain: undefined),Chrome 会忽略这些属性,但 Firefox 可能将其视为过滤条件,导致无匹配结果firstPartyDomain:Firefox 的 First-Party Isolation (FPI) 开启时,需要firstPartyDomain: null才能返回所有 cookie修复方式:新增
cookieQuery()工具函数,过滤undefined属性并在 Firefox 下自动添加firstPartyDomain: null,应用于所有chrome.cookies.*调用(list/set/delete)。Screenshots / 截图
N/A