google-chrome - chrome.cookies.set 不在隐身窗口中创建 cookie
问题描述
我正在尝试创建 Chrome 扩展来管理 cookie 我为此创建了这个简单的代码
清单.json
{
"name" : "cookie_tester",
"version" : "0.1",
"description" : "Tool for cookie mechanism",
"permissions": [ "cookies", "tabs", "activeTab", "storage", "<all_urls>"],
"icons": {
"128": "icon.png"
},
"page_action": {
"default_icon": {
"128": "icon.png"
},
"default_title":"cookie_tester"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"manifest_version": 2
}
background.js 在这里https://pastebin.com/raw/YpQRqvZr
因此,当我激活隐身窗口并单击扩展图标时:未创建 cookie。 未创建 cookie
当然我已经允许这个扩展在隐身模式下工作 允许隐身模式 你能帮我找出原因吗?Chrome 版本是版本 71.0.3578.80 (Official Build) (64-bit) 在此先感谢
解决方案
谢谢@wOxxOm 是的,当我将隐身键添加到具有值“split”的mainfest 中时,我终于得到了工作结果!
更新 manifest.js
{
"name" : "cookie_tester",
"version" : "0.1",
"description" : "Tool for cookie mechanism ",
"permissions": [ "cookies", "tabs", "activeTab", "storage", "<all_urls>"],
"icons": {
"128": "icon.png"
},
"page_action": {
"default_icon": {
"128": "icon.png"
},
"default_title":"cookie_tester"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"manifest_version": 2,
"incognito": "split"
}
推荐阅读
- python - 如何使用python搜索奇数
- r - 如何将回归的汇总统计数据从 R studio 导出到 Excel
- r - 如何使用具有两个感兴趣变量的 emmeans 仅指定感兴趣的比较
- c++ - 为当前程序直接从任何 GPU 内存中提取(原始或编码)视频帧?
- python - python:以十六进制打印netlink消息
- windows - Windows:一个 Window 可以有多少个区域的限制?
- python - 从尚未使用 snakemake 创建的文件中读取参数
- git - 图书馆和日志文件夹出现,虽然有一个 .gitignore 文件
- java - 在函数完成执行之前获取一个函数以更新其 JFrame
- python - 如何在 python 中生成三个月日期?