Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by coderunner

I am trying to run the demos locally in Chrome but get the following errors when starting index-desktop.html:

Uncaught Error: SECURITY_ERR: DOM Exception 18
Unable to get image data from canvas because the canvas has been tainted by cross-origin data.

However, I can run it in Firefox locally fine. Am I doing something wrong?

1 decade ago by coderunner

I just re-read this and realized i forgot a lot of information lol.

i downloaded the stable release package 1.19 and extracted and ran the physics demo file without tinkering with anything else.

1 decade ago by Arantor

Depends on what you define as 'locally'. Chrome is a lot tighter on security matters, namely where you're getting files from for running scripts, as it considers the origin of things.

Where is index-desktop.html and where are all the other files (and how are they being accessed)?

1 decade ago by coderunner

Hi Arantor,

Basically, I just downloaded the release package and extracted it to my desktop. Navigated to the physics demo folder and opened the index-desktop.html from it's location within the physics demo folder. I don't have a webserver or anything set up, but the demo program seemed to run fine in Firefox. I just get that error in Chrome.

I tried this on two computers and both get the same error message in Chrome.

I did try googling the error message, and, based on the same error message in other applications, it does seem to be based on the referenced image file not being an allowable location. I can't find any option in Chrome to set exclusions for this though.

1 decade ago by coderunner

Here is the line of code where the error occurs in Chrome in the file /lib/impact/image.js:

var origPixels = origCtx.getImageData(0, 0, this.width, this.height);

1 decade ago by dominic

Sadly, this still isn't fixed in Chrome. Firefox 9 finally got it right though.

While games written with Impact should work offline, most browsers wont allow them to. These browser deny access to certain functions, due to their faulty same origin policy (a file in file://game/lib/ is not considered to be in the same "domain" as a file in file://game/). Opera is a notable exception to this.

~ http://impactjs.com/documentation/getting-started

1 decade ago by coderunner

Thanks Dominic!

Also sorry for being "that guy" that doesn't look through the manual before asking questions. I thought searching through the forums on here and google would cover it but looks like I still missed the explanation in the manual anyway.

1 decade ago by alexandre

Same issue but different emphasis. Moved to this new thread.
Page 1 of 1
« first « previous next › last »