You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a little Elm (0.18.0) app that plays with the giphy.com api. It works within the browser. But while moving it to cordova (android) I received the message "badUrl: ..." for a good url.
I inserted in https://github.com/elm-lang/http/blob/master/src/Native/Http.js at try { xhr.open(request.method, request.url, true); } catch (e) { return callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'BadUrl', _0: request.url })); }
an alert( e );
This unveiled the real cause. In my case it was a problem with the "Content Security Police".
I think "badUrl" is too generic and can be misleading. Is there any good way to incorporate the "real" cause?
The text was updated successfully, but these errors were encountered:
Yes, the alert shows:
It is a screen shot from the android emulator. It also occurs on the device.
For reproducing it you have to install cordova (https://cordova.apache.org/#getstarted) and add the android platform.
Then I tweaked the example app (https://cordova.apache.org/docs/en/latest/guide/cli/index.html) such that the example www/js/index.js embeds the JavaScript code of my Elm app.
The content security policy element within the index.html is <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">
I hope this helps.
I wrote a little Elm (0.18.0) app that plays with the giphy.com api. It works within the browser. But while moving it to cordova (android) I received the message "badUrl: ..." for a good url.
I inserted in https://github.com/elm-lang/http/blob/master/src/Native/Http.js at
try { xhr.open(request.method, request.url, true); } catch (e) { return callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'BadUrl', _0: request.url })); }
an alert( e );
This unveiled the real cause. In my case it was a problem with the "Content Security Police".
I think "badUrl" is too generic and can be misleading. Is there any good way to incorporate the "real" cause?
The text was updated successfully, but these errors were encountered: