Difference between revisions of "Troubleshooting/Local Files"

From Jmol
Jump to navigation Jump to search
(moving local file access tricks to Troubleshoot sction)
(MacOS Chrome automated local file access)
Line 17: Line 17:
 
(Make sure an instance of Chrome is not active when you issue that command.)
 
(Make sure an instance of Chrome is not active when you issue that command.)
  
There is possibly a way to write an AppleScript to do this in one fell swoop.
+
There is possibly a way to [[Troubleshooting/Local_Files/MacChromeAutomator|write an AppleScript]] to do this in one fell swoop.
  
 
== Windows ==
 
== Windows ==

Revision as of 15:53, 6 September 2014

Accessing J(S)mol-containing webpages in local disk, or loading models from local files

MacOS

Safari

Symptom: trying to load an html file with JSmol/Java in Safari. The applet tries to load but then fails.

Solution: Safari > Preferences > Advanced > check the Show Develop menu in menu bar option.
In the resulting Develop toolbar drop-down, check the Disable Local File Restrictions option.

Caveat: when models in binary-format files are to be loaded, Safari may fail in any case for local files.

Chrome

A command entered in the terminal allows to start up MacOS Chrome so that JSmol runs from local files:

open /Applications/Google\ Chrome.app --args --allow-file-access-from-files

(Make sure an instance of Chrome is not active when you issue that command.)

There is possibly a way to write an AppleScript to do this in one fell swoop.

Windows

Firefox

You will be able to read both binary and text files locally. Please enter about:config in the url address slot and then set security.fileuri.strict_origin_policy false.

Chrome

If you need to open local files, start Chrome using the command-line flag --allow-file-access-from-files. Beyond that, same as for MSIE/Windows below.

MSIE

It is not possible to load local binary files into JSmol/HTML5 from standard script commands. That is, no direct file reading with any of the following in their names:

 .bin .gz .jmol .jpg .map .mrc .omap .png .pse .smol .spartan .zip

This does not apply to files drag-dropped onto the Jmol object or files loaded using "?", which use the HTML5 FileReader object. That method reads binary files without a problem.

Contributors

AngelHerraez