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:

  1. What could cause Chrome to set the Origin: chrome-extension:// header inconsistently for some Windows users?
  2. Is there a way to force Chrome not to set the Origin header for API calls made by the extension?
  3. 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!

本文标签: