views:

75

answers:

1

I want to run this chrome experiment locally. I copied the .html and .js files, along with the two .jpgs that the demo uses. However, when I run it off my local drive, Chrome gives this error:

light.js:89 - Uncaught Error: SECURITY_ERR: DOM Exception 18

Line 89 returns the image data from the canvas after drawing the image to it. What's causing this security exception? It seems to not be Chrome-specific, as Firefox gives the same error.

+3  A: 

Sounds like the JavaScript is making the same origin policy or local data access prevention kick in when you try to run it from your local system.

Looking at the code, it may well be trying to read a resource from your system in such a way that both browsers do not allow since the file is locally stored.

Geoff Adams
Yup, this is most likely a security problem in the `file:///` context. If you have a local web server running, put it on there. It should run without problems.
Pekka