1

Am having a slightly confusing problem with this extension (although it might just be my inexperience) in my manifest file I have:

"permissions": [ "http://mafre.com/","http://eee.se/","http://ilaafire.net/","notifications","tabs" 

And i am using this code to send an XML request:

var http = false; http = new XMLHttpRequest(); function replace() { http.open("GET", "http://www.mafre.com/proj/test.php"+getquerystring(), true); http.onreadystatechange=function() { if(http.readyState < 4) {show_wait_gif();} else if(http.readyState == 4) { updatepage( http.responseText); } } http.send(null); } 

which my script on the other end is getting the data... but when I need to get the response Chrome is throwing this error:

XMLHttpRequest cannot load http://www.mafre.com/proj/[email protected]. Origin chrome-extension://kjggpdimdloblnddfbnodggchjpalihb is not allowed by Access-Control-Allow-Origin. 

Why is that? I have already given it permission to interact with the domain so why cannot I get the response even though it is sending the query?

The response that I should get back into my page is something like "email accepted, thanks!1"

Thanks!

1 Answer 1

6

I believe you should wildcard permission URLs, also www. is a different domain:

"http://mafre.com/*", "http://www.mafre.com/*", "http://eee.se/*", "http://www.eee.se/*", "http://ilaafire.net/*", "http://www.ilaafire.net/*", "notifications", "tabs" 

Currently you only have access to exactly http://mafre.com/.

Sign up to request clarification or add additional context in comments.

3 Comments

@Ryan: It does for me. Did you reload the extension?
@Ryan: I uploaded the most trivial version and it works: 2shared.com/file/850FaUZF/origin.html.
ARRRGH! My stupid fault, i had two manifest files open and was editing the wrong one (serious DUH! moment). Your solution works perfectly and sorry for the above. Wish i could vote up your help x1000, and another x10000 for my stupidity. Thanks again!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.