DomToImage error causing a security error (Dom Exception 18) for iOS browsers only

I am trying to use the dom-to-image plugin . Here is my sample code.

www.avarachan.com/test.html

IT works fine on the desktop, but on iphone it gives an error

security bug dom exception 18

I tried the following htaccess options

Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header set Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS" 

Error. it works on chrome on android (I tested using a browser). Only iOS Chrome and Safari continue to throw an exception. Even with div and text.

There is a similar library https://github.com/niklasvh/html2canvas , and it works on mobile devices. But the library is not as good as the house-image. Can someone with js and canvas know how, apparently, it works fine in iOS, and may be offered a solution to make work on the image on a mobile phone?

+4
source share
2 answers

"DOM Exception 18 usually means that you exceeded the allowable quota on the device (50 MB), although in some environments this happened because Apple removed WebSQL support (for example, WKWebView).

Source: https://github.com/pouchdb/pouchdb/issues/4234

+2

,

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src: 'self' 'unsafe-inline' 'unsafe-eval'">

+2

Source: https://habr.com/ru/post/1659435/


All Articles