Unable to access local icon images for HTML app with Ionic
-
Hi,
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?
Thanks,
Jitto -
You can try adding
--local-content-can-access-remote-urlsto theExec=line in your.desktopfile, as an argument towebapp-container. -
@dobey It does not seems to be working. I tried following 2 options
One:
Exec=webapp-container --allow-file-access-from-files --app-id="testionic.jitto" $@ www/index.htmlTwo:
Exec=webapp-container --local-content-can-access-remote-urls --app-id="testionic.jitto" $@ www/index.htmlBoth are not working. Same error ... :anxious_face_with_sweat:
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login