You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In short: Yes, Chrome will keep the permission "granted" for existing users during the upgrade from 1.2.0 to the latest version.
Chrome tracks the "granted" state of permissions, not just their declaration in the manifest. Since your existing users already explicitly or implicitly granted the background permission (as it was a required permission in 1.2.0), that "granted" flag remains in Chrome's internal database for your extension ID.
The Upgrade Behavior
Existing Users: When they update, Chrome sees that the permission was previously granted. It doesn't "revoke" it just because you moved it to optional_permissions. The extension will continue to have access to the background functionality without prompting the user again.
New Users: Users who install the "latest" version for the first time will not have the permission granted by default. You will need to programmatically call chrome.permissions.request() to trigger the prompt for them.
Activity
CodFrm commentedon Dec 3, 2025
https://developer.chrome.com/docs/extensions/reference/permissions-list?hl=zh-cn#:~:text=%E7%9A%84%E8%AE%BF%E9%97%AE%E6%9D%83%E9%99%90%E3%80%82-,%22background%22,-%E4%BD%BF%20Chrome%20%E6%8F%90%E5%89%8D
扩展配置了 "background" 后,就会出现这个情况,我尝试了一下,将 "background" 放在 optional_permissions 中,然后需要时再使用 chrome.permissions.request 申请,似乎也是可以的
我理解大部分用户其实是不用后台脚本的,固定这个模式会造成一些困扰,我在下一个修复版本中增加一个选项用于控制是否持续在后台运行(默认关闭)
cyfung1031 commentedon Dec 3, 2025
相關:
cyfung1031 commentedon Jan 1, 2026
@CodFrm
从 1.2.0 升上 1.2.3 的用户,会维持准许状态
我感觉这个就是最近一堆 userscript 警告提示无法关掉 报告出现的原因
即使现在是 optional
之前 1.2.0 是准许的,所以升级后还是维持准许状态
因此到了 1.2.3, 还是一直有这样的报告出现
因为关掉浏览器也不会真正关掉,所以警告提示一直维持,除非用户重启电脑。
我發現現在已經有這個開關按鈕。
不過如果没有背景脚本的話,自動移除 permission 會比較好。
验证
Step 0
先下载 1.2.0 和 1.2.3 zip包
scriptcat-v1.2.0-chrome.zip
scriptcat-v1.2.3-chrome.zip
各自解压
Step 1
打开 chrome,
移除 ScriptCat ,重启Chrome (不止关浏览器。如有残留,需要force quit)
用 chrome://extensions/ -> Developer Mode -> Load unpacked -> 安装 1.2.0
(如没有打开
https://docs.scriptcat.org/en/docs/use/install_comple随便打开一个网站,例如 https://www.google.com/ )在 chrome://extensions/ 点 service_worker 的 DevTools
显示
true把 1.2.3 的解压内容覆盖 1.2.0 的解压内容
用 chrome://extensions/ -> Developer Mode -> Load unpacked -> 安装同一个资料夹
(如没有打开
https://docs.scriptcat.org/en/docs/use/install_comple随便打开一个网站,例如 https://www.google.com/ )在 chrome://extensions/ 点 service_worker 的 DevTools
显示
trueStep 2
移除 ScriptCat ,重启Chrome (不止关浏览器。如有残留,需要force quit)
用 chrome://extensions/ -> Developer Mode -> Load unpacked -> 安装同一个资料夹
(如没有打开
https://docs.scriptcat.org/en/docs/use/install_comple随便打开一个网站,例如 https://www.google.com/ )在 chrome://extensions/ 点 service_worker 的 DevTools
显示
false相关
Gemini
In short: Yes, Chrome will keep the permission "granted" for existing users during the upgrade from 1.2.0 to the latest version.
Chrome tracks the "granted" state of permissions, not just their declaration in the manifest. Since your existing users already explicitly or implicitly granted the
backgroundpermission (as it was a required permission in 1.2.0), that "granted" flag remains in Chrome's internal database for your extension ID.The Upgrade Behavior
optional_permissions. The extension will continue to have access to the background functionality without prompting the user again.chrome.permissions.request()to trigger the prompt for them.