remotely-save/docs/browser_env_cors.md

15 lines
1.1 KiB
Markdown
Raw Normal View History

2022-02-11 18:00:32 +00:00
# Limitations From The Browser Environment: CORS Issue
2022-02-11 18:23:47 +00:00
The plugin is developed for the browser environment. The "fake" browser behind the scenes also follows the CORS policy.
2022-02-11 18:00:32 +00:00
[MDN has a doc about CORS.](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
1. From Obsidian desktop >= 0.13.25 or mobile >= 1.1.1, Obsidian [provides a new API `requiestUrl`](https://forum.obsidian.md/t/obsidian-release-v0-13-25-insider-build/32701), that allows the plugin to fully bypass the CORS issue. As of Mar 2022, the latest public-released Obsidian desktop has supported this API, but the Obsidian mobile still stays in insider.
2022-02-11 18:00:32 +00:00
2. For using this plugin in Obsidian desktop < 0.13.25 or mobile < 1.1.1, we need to configure the server side to return the header `Access-Control-Allow-Origin` allowing the origins `app://obsidian.md` and `capacitor://localhost` and `http://localhost`.
2022-02-11 18:00:32 +00:00
2022-02-20 21:54:30 +00:00
Example configurations:
2022-04-30 03:59:38 +00:00
2022-02-20 21:54:30 +00:00
- [Amazon S3](./s3_cors_configure.md)
- [Apache](./apache_cors_configure.md) ([contributed by community](https://github.com/remotely-save/remotely-save/pull/31))