当前位置:网站首页>【Chrome扩展程序】content_script的跨域问题
【Chrome扩展程序】content_script的跨域问题
2022-04-23 02:03:00 【NXY666】
一、问题起因
众所周知,Chrome浏览器对跨域限制有一种很深的执念,在使用 XMLHttpRequest 或 fetch 访问外部网站时必须要目标服务器配合。令我惊喜的是,在谷歌官方文档中有专门的一篇文章讲述扩展程序解除跨域限制的方法。

二、功能测试
根据文档的说法,只要在 manifest.json 中填写 host_permissions 即可解除跨域限制,甚至支持使用通配符解除所有网站的跨域限制。

然而,不幸的是,当我完全按照谷歌提供的示例代码编写时,却提示被拦截。


![]()
三、希望破灭
经过5个小时的搜索,我在Chrome的官方博客中找到了一篇文章,彻底击碎了我的幻想。Changes to Cross-Origin Requests in Chrome Extension Content Scripts
https://www.chromium.org/Home/chromium-security/extension-content-script-fetches/

As part of a broader Extension Manifest V3 effort to improve extension security, privacy, and performance, these cross-origin requests in content scripts will soon be disallowed.
翻译过来就是:
作为更广泛的扩展清单 V3 的一部分,为了提高扩展程序的安全性、隐私性和性能,这些内容脚本(content_script)中的跨域请求很快就会被禁止。
又是该死的安全性。
版权声明
本文为[NXY666]所创,转载请带上原文链接,感谢
https://blog.csdn.net/NXY666/article/details/124309832
边栏推荐
- 013_基于Session实现短信验证码登录流程分析
- Use of push() and pop()
- 用TensorFlow实现线性回归(包括过程中出现的问题及解决方法)
- What is a makefile file?
- Leetcode46 Full Permutation
- Today will finally write system out. Println()
- LeetCode 447. Number of boomerangs (permutation and combination problem)
- JDBC cannot connect to MySQL, and the error is access denied for user 'root' @ '* * *' (using password: Yes)
- Analyze the three functions of static proxy IP.
- [Dahua cloud native] micro service chapter - service mode of five-star hotels
猜你喜欢

Why is one plus one equal to two

Some tips for using proxy IP.

如何设置电脑ip?

postman里面使用 xdebug 断点调试

2022 Saison 6 perfect Kid Model IPA national race Leading the Meta - Universe Track

Dimension C China helping farmers in rural areas warms people's hearts the third stop is jiabaoguo farm

Leetcode46 Full Permutation

我国科学家揭示突破水稻产量瓶颈新机制

Dynamic memory management

批处理多个文件合成一个HEX
随机推荐
MySQL active / standby configuration binary log problem
[Dahua cloud native] micro service chapter - service mode of five-star hotels
Sqlserver data transfer to MySQL
搭建网站是用物理机还是云主机好?
How to write the resume of Software Test Engineer so that HR can see it?
Batch multiple files into one hex
简洁开源的一款导航网站源码
Heap overflow of kernel PWN basic tutorial
[experience tutorial] Alipay balance automatically transferred to the balance of treasure how to set off, cancel Alipay balance automatically transferred to balance treasure?
Introduction to micro build low code zero Foundation (lesson 2)
What should I pay attention to when using proxy IP?
NPM yarn startup error [resolved]
[tutorial] how to use GCC "zero assembly" for white whoring MDK
2022.4.22-----leetcode. three hundred and ninety-six
2022.4.10-----leetcode. eight hundred and four
Dynamic memory management
About how to import C4d animation into lumion
一加一为什么等于二
EBS:PO_ EMPLOYEE_ HIERARCHIES_ ALL
在使用代理IP前需要了解哪些分类?