[Firefox] 无法修改使用 CSP 的网站的页面属性
作者: chocolateboy创建于 2020年6月5日更新于 2026年9月8日
标签firefoxexternal
问题是什么?
在以下组合下,无法修改或修改页面窗口对象的直接或嵌套属性:
- Violentmonkey for Firefox
- 使用 CSP 的网站(例如 GitHub、Google、Twitter)
使用 CSP 的网站在 Firefox 中的 Violentmonkey 中不会运行,除非启用了 @inject-into content,但 @inject-into content 不兼容与 unsafeWindow(或 [@grant none](https://wiki.greasespot.net/index.php?title=@grant&oldid=7438)),后者是修改页面对象所需的。Firefox 上对此有 解决方法,但其使用并不总是明显,而且需要特定的浏览器/引擎代码,而用户脚本本意就是要消除这种代码。
内容来源: violentmonkey/violentmonkey