hexwab
hexwab

Reputation: 1841

XHR local files from a local file

I have a local (file:///) HTML page that tries to AJAX resources from its local directory. For years now Chrome has blanket forbidden all XHRs to file:/// URIs regardless of origin, which is annoying, but at least there's Firefox. But recent Fx versions have started replicating this behaviour. This seems like a good time to solve the problem once and for all. So:

How do I mark an entire local directory (and preferably its subdirectories) as being a single origin for the purposes of XHR and CORS?

It would be nice if:

This sounds like just the kind of problem that MHTML or MAFF or webarchive would help with, except that they're not universally available, or are deprecated, or both. Plus having the constituent files easily editable is important for my particular use case.

"Solutions" I'd rather avoid:

What's best practice here?

Upvotes: 2

Views: 1507

Answers (1)

T.J. Crowder
T.J. Crowder

Reputation: 1075537

How do I mark an entire local directory (and preferably its subdirectories) as being a single origin for the purposes of XHR and CORS?

You can't. You'll have to use one of the solutions you'd rather avoid.

Upvotes: 4

Related Questions