简体   繁体   English

在使用canvas.toDataURL(“image / png”)时,仅在Safari中使用SECURITY_ERR:DOM异常18

[英]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.

相关问题 SECURITY_ERR:调用Canvas的toDataURL方法时,DOM异常18 - SECURITY_ERR: DOM Exception 18 when invoking toDataURL method of the Canvas DOM异常:使用getImageData时,SECURITY_ERR(18) - DOM Exception: SECURITY_ERR (18) when using getImageData 无法从toDataURL()获取图像数据,获取错误SECURITY_ERR:DOM异常18 - Unable to get image data from toDataURL( ), Getting error SECURITY_ERR: DOM Exception 18 IE9:canvas.toDataURL SECURITY_ERR - IE9: canvas.toDataURL SECURITY_ERR iPad Safari iOS - SECURITY_ERR:访问“document.cookie”时的Dom Exception 18 - iPad Safari iOS - SECURITY_ERR: Dom Exception 18 when accessing “document.cookie” canvas.getImageData:“未捕获的错误:SECURITY_ERR:DOM异常18” - canvas.getImageData: “Uncaught Error: SECURITY_ERR: DOM Exception 18” Awesomium JavaScript错误:SECURITY_ERR:DOM异常18 - Awesomium javascript error: SECURITY_ERR: DOM Exception 18 仅限Android浏览器:canvas.toDataURL引发未捕获的错误:SecurityError:DOM异常18 - Android Browser only: canvas.toDataURL throws Uncaught Error: SecurityError: DOM Exception 18 Chome 中的 HTML5 视频,SECURITY_ERR:DOM 异常 18 - HTML5 Video in Chome, SECURITY_ERR: DOM Exception 18 SECURITY_ERR:Web Workers的DOM异常18 - SECURITY_ERR: DOM Exception 18 with Web Workers
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM