caiiiycuk / js-dos

The best API for running dos programs in browser

Home Page:https://js-dos.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

loading bundles via file:// fails

frenchtoastbeer opened this issue · comments

It seems that only http:// loading is supported. I created a:

jsdos.html
mtt.jsdos
v7.4.7/js-dos.js
v7.4.7/js-dos.css

and attempted to load directly off the filesystem via the file:// protocol, but CORS is blocking the loading for mtt.jsdos in firefox and chrome. It looks like I'd have to host this via a webserver, but that's more involved than I'd like.

Is there a Dos(..).run() equivalent that accepts the file inline, perhaps as base64 encoded? How could I do this without a webserver?

Hi. This is correct behavior of browser. You can't load using file://protocol. I mean this is not a js-dos issue. You can use createObjectUrl to create a url from byte array. Use it to achieve what you want.