I build an media control webapp to control my tv and av-receiver with one single app by using the web APIs of the devices. Currently I call a PHP script by an ajax request and the PHP script do the API call by using curl. So I have no problems with Cross-Origin-Requests. But I always have to run a web server. It is theoretically possible to do the ajax request directly to the web API but then I get a cross-origin-request-error. And I have no way to configure the http headers of the devices. So the question is: Is ist possible to allow Cross-Origin-Requests in GeckoView by default?
Asked
Active
Viewed 572 times
2 Answers
0
If you don't have the access to allow it on the devices, The only option you have is to use a proxy server, as you already did

Hamza Ezzaydia
- 267
- 2
- 13
0
GeckoView currently doesn't offer any way to avoid CORS in web content. If you're writing your own "wrapper" app, however, you could bundle an extension which could do the API requests directly. An example of how this is done can be found here: https://mozilla.github.io/geckoview/consumer/docs/web-extensions

snorp
- 96
- 2