关于在 Safari 浏览器上部分网站无法运行油猴脚本的问题说明
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Start with the issue's Safari and Content-Security-Policy behavior report, then reproduce the failure on a CSP-enabled site using the userscript extension. Investigate whether Safari provides a supported way to bypass or disable the policy; done requires a verified workaround or clear documentation that none is available.
Written by the indexing model from the issue text.
Description
一直以来都有人反馈我的某个油猴脚本在 Safari 浏览器下无法访问,但是我多次远程协助也没找到原因(我没有 MAC 设备),直到刚才在热心人士的帮助下,经过测试研究,最后发现:
之所以 Safari 浏览器在部分网站下无法运行油猴脚本,均是因为这些网站配置了 Content-Security-Policy(内容安全策略)。
在其他浏览器上,CSP 不会影响油猴脚本,因为浏览器扩展在插入油猴脚本时,会忽略网站的 CSP 策略。
但是 Safari 浏览器很奇葩的不与其他浏览器为伍,在浏览器扩展插入油猴脚本时会遵守网站的 CSP 策略,导致油猴脚本被阻止(显然这些网站不会将油猴脚本的路径加入 CSP 策略中)。
查询搜索后发现,似乎目前没有任何方法可以在 Safari 浏览器上绕过/禁用 CSP 策略,因此凡是启用 CSP 策略的网站均无法在 Safari 浏览器上依靠扩展运行油猴脚本。
当然如果你有解决方法的话,欢迎在下面告诉我~
- Dominant language
- JavaScript
- Stars
- 10k
- Forks
- 706
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from XIU2/UserScript
-
goapk.com安智网 Open功能建议
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
XIU2/UserScript#627 ·
-
功能建议
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
XIU2/UserScript#598 ·
-
反馈问题
Difficulty 4/5 3-5 days Newbie friendliness 35/100
XIU2/UserScript#629 · 2 comments ·
-
功能建议
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
XIU2/UserScript#625 · 1 comment ·
-
功能建议
Difficulty 3/5 1-2 days Newbie friendliness 68/100
XIU2/UserScript#624 · 1 comment ·
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100