On Apr 5, 5:50 am, breedish <breed...@gmail.com> wrote:
> Hi to everybody.
>
> I have a problem, a i'm making a simple extension for our project for
> chrome, to manage(switch) modes of our application.
> So now i have just several links for each mode in popup.html. I make a
> request for a background script to connect to my local applicationhttp://localhost:8080/ams/internal/modes.jsp?par=1&... etc So request
> passes ok. In response i send simple json
> { mode : '1' }. But when i try to get xmlhttprequest responseText it
> always has empty string. And xmlhttrequest.state is always 0.
> I have no problem with other domain.
>
> Is there any restrictions on localhost ?
First, make sure you give your extension the necessary network
permissions in your manifest.json file.
Second, my extension also makes ajax requests to localhost, and I had
some problems with that. If I recall correctly, changing from
localhost to 127.0.0.1 helped.
Hope it works for you.
Amos