PHP前端开发

我们能通过脚本删除HTML5 Canvas标签的“getContext”属性吗?

百变鹏仔 4周前 (09-22) #HTML
文章标签 脚本

HTML5规范中没有说明,脚本删除getContext属性是有效的。

我们可以编写一段代码,删除HTMLCanvasElement的getContext属性,然后在单独的语句中删除我们将其设为未定义。

Delete window.HTMLCanvasElement.prototype.getContext;_assertSame(window.HTMLCanvasElement.prototype.getContext, undefined,   "window.HTMLCanvasElement.prototype.getContext", "undefined");