Skip to content

Commit 41884e1

Browse files
committed
fix bug:: window-scoped problem . The File|Blob object passed from parent window.
1 parent 04f41af commit 41884e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

js/canvas.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,10 @@
164164
image.src = obj.src;
165165
return;
166166
}
167-
// file
168-
if (obj instanceof File || obj instanceof Blob) {
167+
// file the File|Blob object maybe come from parent's window.
168+
if (obj instanceof File
169+
|| obj instanceof Blob
170+
||(parent&&parent.window&&(obj instanceof parent.window.File||obj instanceof parent.window.Blob))) {
169171
var reader = new FileReader();
170172
reader.onload = function(event) {
171173
image.src = event.target.result;

0 commit comments

Comments
 (0)