0

I’m getting NS_ERROR_DOM_BAD_URI: Access to restricted URI denied when trying to load a webpage in the browser that was copied from the Internet.

I want the web page to run locally without a web server. So my question is whether there is any JavaScript library with a drop-in replacement for XMLHttpRequest that allows to do that.

5
  • Not sure how a different library will solve that. Better solve the underlying issue: See “NS_ERROR_DOM_BAD_URI: Access to restricted URI denied” and the questions linked to it, on our developers' sister site. For more, a little Google search gives tons of answers. Most likely a JS issue with the Same origin policy.
    – Izzy
    Oct 26, 2016 at 6:24
  • rraallvv: So you want the local HTML/JavaScript to be modified to point its XMLHttpRequest requests to a local dummy server, and this dummy server would send empty data, is my understanding correct?
    – Nicolas Raoul
    Oct 26, 2016 at 10:35
  • @NicolasRaoul for instance a request to "sounds/music.mp3" should work either with a web page hosted in the local server (localhost/index.html) and also by loading index.html directly from the file system in the browser window (file:///path/to/index.html)
    – rraallvv
    Oct 27, 2016 at 1:19
  • And would it try to load the mp3 file from the filesystem? Most XMLHttpRequest calls are for dynamic data, you can not know in advance what the request will ask for. Should the page saving mechanism try to imagine all things the XMLHttpRequest call can ever ask for?
    – Nicolas Raoul
    Oct 27, 2016 at 1:27
  • @NicolasRaoul I think createjs does something like that but I have to dig deeper. They have the option preferXHR in the LoadQueue constructor for using HTML tags instead of XMLHTTPRequests
    – rraallvv
    Oct 27, 2016 at 1:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.