Request ajax in a Google Chrome app

Asked

Viewed 659 times

1

I was developing an application in Chrome and needed to use the Instagram api to display some photos but when I went to do the tests the following error appeared: inserir a descrição da imagem aqui

What I found strange because the application has special permission on the site: inserir a descrição da imagem aqui

It’s been a while since I’ve been living with this error, I’ve searched on Google, related questions and I haven’t figured out how to make a request ajax an external site in a Hosted app in Chrome.

Curiosity: This same request works in a normal browser extension but in an app this error happens.

Help me!

  • 1

    Can put a jsfiddle in the air simulating the problem? For sure it is a problem of CORS. I think you’re trying to run a local file in Chrome (without publishing to a lifetime App Server), you probably need to --allow-file-access-from-files.

  • In jsfiddle will work normally, only in Chrome this error.

  • Tries to pass the --allow-file-access-from-files then. Pretty sure that’s the problem.

  • But if I’m going to publish this app, everyone’s going to have to do this? '-'

  • 1

    When you publish the App it will not make local files ajax... Right?

  • external files, in the Instagram api..

Show 1 more comment

1 answer

1


A Chrome App is more protected than an extension. Google keeps improving the Chrome Apps SDK, but the last (and only) time I tried to make an App to test, it wasn’t allowed to access external Urls (CORS). To documentation seems to still say that.

Browser other questions tagged

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