[英]SECURITY_ERR: DOM Exception 18 ONLY IN Safari when using canvas.toDataURL(“image/png”)
In my app I am trying to convert an image to canvas. 在我的应用程序中,我试图将图像转换为画布。 What I am doing is this. 我正在做的是这个。
I am trying to upload image from an external server and when this thing is done if the height of the image is greater then its width I am drawing it on canvas and rotating it. 我正在尝试从外部服务器上传图像,当这个事情完成时,如果图像的高度大于宽度,我将它绘制在画布上并旋转它。
It is working great in Chrome and FF but in Safari I am getting this error 它在Chrome和FF中运行良好,但在Safari中我收到此错误
SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent. SECURITY_ERR:DOM异常18:尝试突破用户代理的安全策略。
I am not getting what this is. 我不知道这是什么。 Can anybody let me know about this? 有人可以告诉我这个吗?
Try finding the exact line that is breaking. 尝试找到破碎的确切线。 When safari is set Always block cookies and other website data then it breaks local storage, and several of the image manipulation APIs. 当设置safari时,始终阻止cookie和其他网站数据,然后它会破坏本地存储和几个图像处理API。 You might try to determine exactly which line is failing, and wrap that line in a try/catch. 您可能会尝试确定哪条线路出现故障,并将该线路包装在try / catch中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.