kylepaulsen / ResourceOverride

An extension to help you gain full control of any website by redirecting traffic, replacing, editing, or inserting new content.
MIT License
467 stars 117 forks source link

How to fix 'Redirects to data: URL are allowed only when mode is "no-cors"'? #32

Open holyjak opened 5 years ago

holyjak commented 5 years ago

Hello,

this is not a bug but perhaps a gap that would be nice to fill in the docs as I suppose it is not an uncommon problem. When I use URL->File redirect, it is applied but the XHR call fails with:

Fetch API cannot load . Redirects to data: URL are allowed only when mode is "no-cors".

Is it possible to fix e.g. by using R.O. to set some req/response headers? Thank you!!!

PS: Perhaps it is related to https://github.com/whatwg/fetch/issues/111 and/or https://bugs.chromium.org/p/chromium/issues/detail?id=521475 but I do not understand the problem well enough.

xvasko commented 4 years ago

I used URL -> URL instead of URL -> File, and pointed the endpoint to https://www.mocky.io/ where I mocked the desired response body.