当前位置:网站首页>【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 Scriptshttps://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
边栏推荐
- Use of push() and pop()
- [experience tutorial] Alipay balance automatically transferred to the balance of treasure how to set off, cancel Alipay balance automatically transferred to balance treasure?
- 89 logistic回归用户画像用户响应度预测
- Thinkphp内核开发盲盒商城源码v2.0 对接易支付/阿里云短信/七牛云存储
- 代理IP可用率是不是等同于代理IP的效率?
- Introduction to esp32 Bluetooth controller API
- Longest common subsequence (record path version)
- How to set computer IP?
- The leader / teacher asks to fill in the EXCEL form document. How to edit the word / Excel file on the mobile phone and fill in the Excel / word electronic document?
- Sqlserver data transfer to MySQL
猜你喜欢
单片机和4G模块通信总结(EC20)
Campus transfer second-hand market source code
easyswoole环境配置
How to "gracefully" measure system performance
World Book Day 𞓜 a good book that technicians should not miss (it cutting-edge technology)
Challenges often faced by client project management
What are the test steps of dynamic proxy IP?
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimensio
Longest common subsequence (record path version)
Leetcode46 Full Permutation
随机推荐
Keil MDK Chinese garbled code, two solutions, the font is no longer ugly
Log4j2 configuration
What should I pay attention to when using proxy IP?
postman里面使用 xdebug 断点调试
MySQL active / standby configuration binary log problem
How to write the resume of Software Test Engineer so that HR can see it?
Implementation of Base64 encoding / decoding in C language
2022.4.20-----leetcode.388
easyswoole环境配置
2022 crane driver (limited to bridge crane) examination question bank and online simulation examination
Easyswool environment configuration
What is a proxy IP pool and how to build it?
What is a boolean type?
What is BGP server and what are its advantages?
Startup of openstack service
ESP32使用freeRTOS的消息队列
The leader / teacher asks to fill in the EXCEL form document. How to edit the word / Excel file on the mobile phone and fill in the Excel / word electronic document?
[experience tutorial] Alipay balance automatically transferred to the balance of treasure how to set off, cancel Alipay balance automatically transferred to balance treasure?
Use of push() and pop()
Chinese scientists reveal a new mechanism for breaking through the bottleneck of rice yield