unconed / MathBox.js

MathBox is a (work in progress) library for making presentation-quality math diagrams in WebGL.
MIT License
1.94k stars 127 forks source link

Is there a way to use MathBox.js from file:// ? #37

Open silgon opened 9 years ago

silgon commented 9 years ago

I noticed the first part on your documents is something like:

document.getElementById('info').innerHTML = "Sorry. This example does not work when accessed using file://. Please use an http:// host and try again.";

And well, I tested and it doesn't work in with file:// and I would like to know if there's a workaround for this. Because I will try to implement MathBox with org-mode on emacs, and for the best use, you always open your files with file:// because since it's only an HTML file, maybe with some javascript and css, you don't need a server. Anyway, I'll appreciate your input. =)

rreusser commented 9 years ago

This is a security feature so that, for example, an html file someone sends you can't look for ~/passwords.txt and send that to their server. Some browsers allow you to disable this, but it's probably best to just start up any number of basic http servers that will serve files locally. For example, python has a nice one:

python -m SimpleHTTPServer 8000

Then fire up your browser an go to http://localhost:8000

borismus commented 9 years ago

+1 this would be great, especially for use within a WebView. Also @unconed are you still actively working on this? Or is this intended to be superseded by MathBox2?