Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Online version broken in Chrome due to Private Network Access #4

Open
sschmidTU opened this issue Feb 10, 2022 · 0 comments
Open

Online version broken in Chrome due to Private Network Access #4

sschmidTU opened this issue Feb 10, 2022 · 0 comments

Comments

@sschmidTU
Copy link
Owner

sschmidTU commented Feb 10, 2022

see https://developer.chrome.com/blog/private-network-access-preflight/
Looks like they finally updated Chrome to block private network access if the request answerer (AnkiConnect) doesn't add the header to allow it.
It still works offline in Chrome, and online in Firefox and Edge, see the readme -> Troubleshooting section.

A solution to this would be patching AnkiConnect to add a setting in the config to set the Access-Control-Allow-Private-Network header to true.

There are already a few issues in AnkiConnect about similar things related to CORS:
https://github.com/FooSoft/anki-connect/issues?q=is%3Aissue+CORS

e.g. this one:
FooSoft/anki-connect#201

They seem to recommend not using the API on a webpage due to the possibility of malicious websites changing your decks, though that is a pretty unlikely event (and not possible on my website, since it's open source and only doing very specific requests).
So, it would at least be nice to have the option to allow this.

sschmidTU pushed a commit that referenced this issue Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant