O'Reilly Forums: Security Error Running Videobooth.js - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Security Error Running Videobooth.js

#1 User is offline   seltzerl 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 08-February 12

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
0

#2 User is offline   Beth Robson 

  • Veteran Member
  • PipPipPipPipPipPipPipPipPip
  • Group: O'Reilly Employee
  • Posts: 376
  • Joined: 17-September 08
  • 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

View Postseltzerl, on 08 February 2012 - 02:23 PM, said:

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
0

#3 User is offline   seltzerl 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 08-February 12

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

This post has been edited by seltzerl: 12 February 2012 - 09:21 AM

0

#4 User is offline   seltzerl 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 08-February 12

Posted 12 February 2012 - 02:24 PM

View PostBeth Robson, on 11 February 2012 - 03:26 PM, said:

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
0

#5 User is offline   Beth Robson 

  • Veteran Member
  • PipPipPipPipPipPipPipPipPip
  • Group: O'Reilly Employee
  • Posts: 376
  • Joined: 17-September 08
  • 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

View Postseltzerl, on 12 February 2012 - 02:24 PM, said:

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users