admin管理员组文章数量:1401233
I have developed a Chrome extension that makes API calls using fetch() to my product server. Since the requests originate from a Chrome extension, the Origin header is usually not set when making these requests. To handle this, my server does not return Access-Control-Allow-Origin headers in the response, and everything works fine for most users. However, for some Windows users, I noticed that Chrome is setting the following Origin header in the API request:
Origin: chrome-extension://<extension-id>
Because my server is not configured to handle Access-Control-Allow-Origin headers, these requests fail with a CORS error.
Key Observations: 1.This issue occurs only on some MS Windows users and not for everyone.
2.The majority of users do not have an Origin header set in the API request.
3.The affected users have the latest version of Chrome.
4.The same extension works fine on other OS platforms like macOS and Linux.
5.The issue persists even after reinstalling the extension.
6.The extension uses fetch() for making API calls, and there are no explicit modifications to request headers.
Questions:
- What could cause Chrome to set the Origin: chrome-extension:// header inconsistently for some Windows users?
- Is there a way to force Chrome not to set the Origin header for API calls made by the extension?
- Is there a Google Workspace admin level chrome setting that sends origin headers
Any insights into the root cause and possible fixes would be greatly appreciated. Thanks in advance!
本文标签:
版权声明:本文标题:Chrome Extension Fetch API Setting Origin Header Unexpectedly for Some Windows Users, Causing CORS Error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744268901a2598083.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论