回答編集履歴
1
チョウセイ
answer
CHANGED
@@ -5,16 +5,12 @@
|
|
5
5
|
[].forEach.call(document.querySelectorAll('img'),x=>{
|
6
6
|
x.addEventListener('click',e=>{
|
7
7
|
var t=e.target;
|
8
|
-
fetch(t.src).then(res=>{
|
9
|
-
|
8
|
+
fetch(t.src).then(res=>new Promise(resolve=>resolve(res.blob())).then(blob=>new Object({
|
10
|
-
console.log({
|
11
|
-
|
9
|
+
type:res.headers.get("content-type"),
|
12
|
-
|
10
|
+
size:blob.size,
|
13
|
-
|
11
|
+
width:t.naturalWidth,
|
14
|
-
|
12
|
+
height:t.naturalHeight,
|
15
|
-
|
13
|
+
}))).then(console.log);
|
16
|
-
});
|
17
|
-
});
|
18
14
|
});
|
19
15
|
});
|
20
16
|
});
|