SyntaxScrewer's Blog

March 16, 2012

Javascript : Unable to load up image files locally – Firefox / Chrome

Filed under: Browsers,Javascript — geekymaira @ 1:39 pm

Hello!

So I found out that for some reason Firefox / Chrome do not allow Javascript to load up local files from the disk.
This is some sort of security restriction.  Maybe its the same with Safari but I haven’t found out a solution for that yet.

Solution (Chrome)  :  For local files to work on Chrome, it has to be started with--allow-file-access-from-files command line flag.
Solution (Firefox)   : For Firefox, there is a similar parameter security.fileuri.strict_origin_policy accessible via about:config.

reference : https://github.com/mrdoob/three.js/issues/343

Hope this helps!

Cheers

SyntaxScrewer

Blog at WordPress.com.