Unable to access local icon images for HTML app with Ionic
I am trying to convert an ionic app to a ubports html app. So I copied all the items from ionic build directory (www) to the www directory of ubports app.
The app launches but the icons are not visible. In the console I got following errors:
Fetch API cannot load file:///home/jitto/ubports/ionicwebview/build/all/app/install/www/svg/chevron-forward.svg. URL scheme "file" is not supported. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///home/jitto/ubports/testionic/www/svg/business.svg. (Reason: CORS request not http).
I am getting the same error when I tried to run the index.html using chrome in desktop. I guess the browser is blocking local resources.
Is there any way to override this behaviour while packaging the html app as a ubports app?
You can try adding
Exec=line in your
.desktopfile, as an argument to
@dobey It does not seems to be working. I tried following 2 options
Exec=webapp-container --allow-file-access-from-files --app-id="testionic.jitto" $@ www/index.html
Exec=webapp-container --local-content-can-access-remote-urls --app-id="testionic.jitto" $@ www/index.html
Both are not working. Same error ...