S
S
Soft_touch_plastic2021-12-29 16:19:33
AJAX
Soft_touch_plastic, 2021-12-29 16:19:33

Why is no HTTP request being made in chrome?

Hello, I am making a browser extension that also accesses a third-party api. Chrome blocks any request with the error Ensure CORS response header values ​​are valid. I googled the problem, it turns out the server just needs to send the Access-Controll-Allow-Origin header, but the problem is that I don’t have any access to the server, this is not my api. And how to be in that case? Thank you in advance!
These are the headers the server gives if you simply execute the request in the browser in a new window:
61cc6044c2223615021485.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2021-12-29
@vabka

And how to be in that case?

Option 1: Install
CORS Unblock extension: https://chrome.google.com/webstore/detail/cors-unb...
Option 2:
Launch browser with flag: --disable-web-security (for chrome)
Option 3:
Host your own server, which will make requests to this foreign apishka and add the desired header.

A
Aetae, 2021-12-29
@Aetae

You must give your extension permission to make cross-domain requests for specific domains.
https://developer.mozilla.org/en-US/docs/Mozilla/A...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question