Jump to content


Photo

Security Error Running Videobooth.js


  • Please log in to reply
4 replies to this topic

#1 seltzerl

seltzerl

    New Member

  • Members
  • Pip
  • 3 posts

Posted 08 February 2012 - 02:23 PM

var frame = buffer.getImageData(0, 0, bufferCanvas.width, bufferCanvas.height);

The above statement fails with these messages in the Chrome JavaScript console (a similar but less informative message appears in the Firebug console in Firefox):

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


Why does this occur, and is there a workaround?

Thanks.

Larry

#2 Beth Robson

Beth Robson

    Veteran Member

  • O'Reilly Employee
  • PipPipPipPipPipPipPipPipPip
  • 377 posts
  • Gender:Female
  • Location:Seattle, WA
  • Interests:I am interested in computer science, the Web, social media and the internet, Mac development, and adult learning.

Posted 11 February 2012 - 03:26 PM

var frame = buffer.getImageData(0, 0, bufferCanvas.width, bufferCanvas.height);

The above statement fails with these messages in the Chrome JavaScript console (a similar but less informative message appears in the Firebug console in Firefox):

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


Why does this occur, and is there a workaround?

Thanks.

Larry


This occurs if you're not using localhost to serve the files. Are you using a local server?
Elisabeth Robson
Co-founder, WickedlySmart.com
Author: Head First JavaScript Programming, Head First HTML5 Programming, Head First HTML and CSS, Head First Design Patterns

#3 seltzerl

seltzerl

    New Member

  • Members
  • Pip
  • 3 posts

Posted 12 February 2012 - 09:20 AM

I'm running it by clicking the .html file in Windows Explorer, so the location field contains file:///C:/Users/Larry/Documents/web_%20pages/Head_First_HTML5_Programming/chapter8/videobooth.html.

I'll try running it on localhost and get back to you.

Thanks very much.

Larry

Edited by seltzerl, 12 February 2012 - 09:21 AM.


#4 seltzerl

seltzerl

    New Member

  • Members
  • Pip
  • 3 posts

Posted 12 February 2012 - 02:24 PM

This occurs if you're not using localhost to serve the files. Are you using a local server?


Beth,

I just tried it under a local Tomcat ( http://localhost:808...videobooth.html ) and it worked as expected. Thanks again.

Larry

#5 Beth Robson

Beth Robson

    Veteran Member

  • O'Reilly Employee
  • PipPipPipPipPipPipPipPipPip
  • 377 posts
  • Gender:Female
  • Location:Seattle, WA
  • Interests:I am interested in computer science, the Web, social media and the internet, Mac development, and adult learning.

Posted 28 February 2012 - 08:41 AM

Beth,

I just tried it under a local Tomcat ( http://localhost:808...videobooth.html ) and it worked as expected. Thanks again.

Larry


Great!! glad to hear it :-)
Elisabeth Robson
Co-founder, WickedlySmart.com
Author: Head First JavaScript Programming, Head First HTML5 Programming, Head First HTML and CSS, Head First Design Patterns




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users