ArnaudBuchholz / chrome-extension-url-mapper

URL mapper for chrome
0 stars 0 forks source link

XMLHttpRequest does not work if remote host does not implement OPTIONS #6

Open ArnaudBuchholz opened 8 years ago

ArnaudBuchholz commented 8 years ago

Cross-Origin XMLHttpRequest implies an initial call to the remote host with the OPTIONS verb (this is named the preflight request). If the remote server does not implement OPTIONS, the call ends with a 501 "Not implemented" error.

ArnaudBuchholz commented 8 years ago

One alternative would be to throw the XMLHttpRequest inside the extension. Indeed, it looks like it skips the preflight request.

I need to verify:

  1. If the preflight request is skipped as expected
  2. If I can force an synchronous XHR inside the extension
  3. I can hook all page XHR queries to go through this mechanism