【发布时间】:2013-05-04 18:05:00
【问题描述】:
我正在尝试在我的 Chrome 扩展程序注入的内容脚本中的 Canvas Context 上使用 drawImage。
testCanvas = document.createElement('canvas');
testContext = testCanvas.getContext('2d');
var image = new Image();
testContext.drawImage(image, 0, 0);
在 Chrome 26 中它可以正常工作,但在开发通道 (Chrome 28) 中,当我收到这条消息时,这个接缝被破坏了:
Uncaught TypeError: Type error
当我将相同的脚本直接移动到后台页面时,它可以正常工作。
我认为这可能与一些安全相关的更改有关,但我没有找到任何相关信息。
【问题讨论】: