On Tue, Jul 12, 2022 at 3:23 PM Jan-Pieter Jacobs
<janpieter.jac...@gmail.com> wrote:
> A pull-request for 2 characters seemed a bit heavy handed, so I report it
> here, hoping you could fix it when you see fit.

Web work is often non-intuitive. (Or, I suspect that a pull request
would have been fine, here.)

> To avoid pushing untested code, how do you test the playground locally? I
> tried just opening index.html in Firefox, which shows the interface, but
> the terminal doesn't work (likely due to some cross-site restrictions of
> the browser, showing up in the developer tools log (Cross-Origin Request
> Blocked: The Same Origin Policy disallows reading the remote resource at
> file:///home/jpjacobs/Projects/J/j-playground/bin/html2/emj.data. (Reason:
> CORS request not http).). I had hoped it would work, since the early J
> browser implementation you made few years back does work when opened from a
> folder (I've used it for years from a downloaded copy with a few tweaks).

I suspect that the same mechanisms which jhs uses to serve images
(such as png files) could be used here.

For example, http://localhost:65001/~addons/labs/labs/examples/data/toucan.png
worked for me.

I think that you would need to update mimetypes_jfilesrc_ with entries
like 'application/octet-stream';'data' and 'application/wasm';'wasm'
(perhaps it would be a good idea to edit ~addons/ide/jhs/jfilesrc.ijs
to accomplish this -- I suspect that the last item in that array needs
to be a:,a: -- but I have not tested this). And, you'd presumably want
to put emj.data and emj.wasm somewhere that jhs normally serves
content from. Again, I have not tested this, but it seems like this
approach should work.

I hope this helps,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to