We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 00af69f + 5e36472 commit f59f381Copy full SHA for f59f381
src/scripts/domParsers/domUtils.ts
@@ -360,7 +360,6 @@ export module DomUtils {
360
// Just passing in the image node won't work as it won't render properly
361
// and the algorithm will think every pixel is (0,0,0,0)
362
let theImg = new Image();
363
- theImg.src = img.src;
364
365
// In Firefox, a SecurityError is thrown if the image is not CORS-enabled
366
theImg.crossOrigin = "anonymous";
@@ -372,6 +371,9 @@ export module DomUtils {
372
371
theImg.onerror = () => {
373
resolve(undefined);
374
};
+
375
+ // The request is kicked off as soon as the src is set, so it needs to happen last
376
+ theImg.src = img.src;
377
});
378
379
}
0 commit comments