当您将来自其他域的图像放在画布中时,画布会受到污染,并且诸如getDataURL或getImageData之类的某些功能会被禁用.
当您尝试使用此类功能时,会发生SECURITY_ERROR错误.
为什么有这种保护措施?这种方法使用了哪种攻击?
谢谢!
编辑:
我应该问:如何将来自其他域的图像用于攻击?
我弄不明白为什么蜂鸣后浏览器限制使用画布.
解决方法:
这是跨域封锁,这类似于事实,您无法从iframe内的页面访问元素,例如…
编辑:
从w3文档中:
Note that the URL given in the ‘src’ or ‘data’ attributes must be on
the same domain as the web page and follows the same domain rule (i.e.
same protocol, port, etc.); cross-domain object insertion is not
supported for security reasons.
但是我碰到了这一点,也许您可以解决一些问题:
http://dev.w3.org/SVG/tools/svgweb/docs/UserManual.html#cross_domain
顺便说一下,Java脚本中的跨域可以在较新的浏览器上运行,但是您需要拥有两个域,并配置连接以使其被视为可信,请参见此处:
http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
原文地址:https://codeday.me/bug/20191011/1895686.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。