Open Bug 1412016 Opened 2 years ago Updated 2 years ago

cross domain issue


(Developer Documentation :: Games, defect, P5)



(Not tracked)



(Reporter: ugajin, Assigned: cmills)




:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

There is an issue with the following lines in Chrome browser:

game.load.image('ball', 'img/ball.png'); 
ball = game.add.sprite(50, 50, 'ball');

Code renders fine in Firefox and Safari, but throws the following error in Chrome:

Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at .../img/ball.png may not be loaded.

I have encountered similar issues previously, when content is 'served' locally. Is there a simple fix, which does not require a server? 

I am running OSX
macOS Sierra version 10.12
Firefox: v56.0 (64bit)
Safari: Version 10.0 (12602.
Chrome: Version 61.0.3163.100 (Official Build) (64-bit)

Thank you!
Hi there,

Yes, this is a problem because of Chrome's recent move to stricter security policies.

To fix it, you'll have to use a local server and look at your demo files through that. We've written up an easy way to do this at

I probably ought to link to this from the article series.
Assignee: nobody → cmills

Yes, I found the Python solution via the, they cover the how and why [server] questions pretty thoroughly, and include a link to an article on linuxjournal [dated Sept. 2009!] which provides the Bash/Python [v2 Python] commands.

I have Apache [factory OSX] installed, but I like the Python server solution better for this type of thing.

Also, it is a big thumbs up from me, to the game dev fairies. I have looked at 3 of the 4 tutorials. They are carefully written, and close to exceptional. Ironic too,  AFAIR they are [far] better than anything I have [so far] found on and/or elsewhere.

The cross-origin issue is also encountered here:


You need to log in before you can comment on or make changes to this bug.