Middle-ear finite-element model Using Thrwp’ny with local files

In response to a security issue, many Web browsers will not open local files even if they’re in the same local directory as the HTML file requesting them (ref). This means that Thrwp’ny will not work.

This became the default behaviour in Firefox 68. It can be changed by going to about:config and setting privacy.file_unique_origin to false. This change can be made temporarily to allow models to be developed and viewed locally without write access to a Web server. I do not know what the situation is with Web browsers other than Firefox.

Another approach is to install a web server locally and access the files through that. There are many such programmes available. One solution involves installing Python 3. Then, at the command line, use the command cd to get into the directory where your model’s .tr3 file is located and give the command
python -m http.server 8000 --bind 127.0.0.1
You should then see a message saying
Serving HTTP on 127.0.0.1 port 8000 (http://127.0.0.1:8000/) ...
(The numbers 127.0.0.1 and 8000 are more or less arbitrary but they are conventionally used. If you have both Python 2 and Python 3 installed, you may need to use the command python3 rather than just python.)

At this point, get into a Web browser on the same computer, type http://127.0.0.1:8000/json/ into the address bar, and hit Enter. A directory listing of your json/ directory should be displayed and you can click on the entry for the .html file corresponding to your model. Thrwp’ny should then appear.

When you’re finished with the web server, you can terminate it by typing Control-C.


R. Funnell
Last modified: 2021-07-15 23:18:58