How to upload external images to a Chrome app?

Asked

Viewed 63 times

1

My application uses the Imgur api to host images, but at the time it will load the photos, the following error appears: Erro

I’ve tried using the content_security_policy in the archive manifest but this message appears: Mensagem

What to do?

2 answers

2

Try updating the application’s manifest.json with the url you want to access.

"permissions": ["storage", "webview", "<all_urls>"]

The <all_urls> has the same effect as http://*/* or https://*/* or *://*/*. (Access your data on all websites).

You can try using the permission webview also:

Use the webview tag to actively load live content from the web over the network and embed it in your Chrome App.

If you have any questions about permissions "warnings", go to:

http://developer.chrome.com/extensions/permission_warnings

  • That’s the same as "http:///", "https:///"? Because you already have

  • 1

    updated my answer ;)

2

If I’m not mistaken, it’s only possible to include urls that you have https, I’ve already created a Chrome extension to calculate Running pace that can be seen mo link

You can also try adding the permission in the manifest:

    "content_security_policy": "script-src 'self' https://i.imgur.com 'unsafe-eval'; object-src 'self'"
  • You are giving the same error to the image in https =/

  • I adjusted the answer by adding a possible modification to the manifest.

  • Luis, if you look at the question, you’ll see that Chrome does not accept the "content_security_policy" =/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.