我玩形状检测API(https://github.com/WICG/shape-detection-api),在此基础上的例子:https://wicg.github.io/shape-detection-api/#examples形状检测API:“抛出:DOMException:源会玷污血统”
我试图让最简单的工作:
let faceDetector = new FaceDetector({fastMode: true, maxDetectedFaces: 1});
// Assuming |theImage| is e.g. a <img> content, or a Blob.
faceDetector.detect(theImage)
.then(detectedFaces => {
for (const face of detectedFaces) {
console.log(' Face @ (${face.boundingBox.x}, ${face.boundingBox.y}),' +
' size ${face.boundingBox.width}x${face.boundingBox.height}');
}
}).catch(() => {
console.error("Face Detection failed, boo.");
})
然而,我正在错误:
VM153:1 Uncaught (in promise) DOMException: Source would taint origin.
与我使用图像变量是来自计算器图像中的一个:
<img src="https://www.gravatar.com/avatar/619aaf27f793d8ffdbc879c74884c0cc?s=32&d=identicon&r=PG" alt="" width="32" height="32" id="testimg">
我的浏览器是Google Chrome Canary 61.0.3128.0,启用了实验性Web功能。
我错过了什么吗?