-
-
Notifications
You must be signed in to change notification settings - Fork 66
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
cookies下载后主机限定域名变为非主机限定域名
To Reproduce
Steps to reproduce the behavior:
- 打开任意设置非主机限定cookies的网站,(cookies中domain字段非.开头)
- F12打开开发者工具Application页签cookies确认cookies数量与Domain字段值
- 上传cookies
- 下载cookies
- 非.开头的cookies被重复添加一份.开头的cookies
Expected behavior
cookies被原样恢复
Screenshots

如图,最上方,开发者工具查看目标网站cookies,原始cookies为us.*.*.host(内网域名,已隐去);
上传时通过插件开发者工具抓取确认上传信息无误;
下载时通过开发者工具抓取确认下载信息无误;
断点跟踪pullAndSetCookies,确认信息无误(左侧为调试界面,右侧为对应源码);
最下方,开发者工具查看目标网站cookies,新增一条非主机限定域名cookie.us.*.*.host(域名前带.),name与value与原始记录完全重复,仅domain不同;
Desktop (please complete the following information):
- OS: Windows
- Browser chrome
Additional context
可能的解决方案,供参考:
fanhuanji@a9e669b
注释/删除下面代码行后本issue所指现象消失,未做任何其他场景测试验证,建议详细评估并针对主机限定/非主机限定域名场景增加相关逻辑;
| domain: cookie.domain, |
const cookieDetail: chrome.cookies.SetDetails = {
// ## REMOVE THIS LINE ## domain: cookie.domain,
name: cookie.name ?? undefined,
url: url,
storeId: cookie.storeId ?? undefined,
value: cookie.value ?? undefined,
expirationDate: cookie.expirationDate ?? undefined,
path: cookie.path ?? undefined,
httpOnly: cookie.httpOnly ?? undefined,
secure: cookie.secure ?? undefined,
sameSite: (cookie.sameSite ?? undefined) as chrome.cookies.SameSiteStatus,
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working