HTML and CSS Reference
Figure 3-11. Canvas exported image with toDataURL()
SECURITY_ERR: DOM EXCEPTION 18
In some web browsers, such as Google Chrome, you might experience an error (SECURITY_ERR:
DOM Exception 18) when trying to export the canvas while an image is displayed (like the pattern
fill type in Example 3-1 ). This usually occurs because the web browser is executing a web page loc-
ally (loaded from the filesystem). These errors can usually be removed by loading the HTML page
from a web server—either remotely or on your local machine.