<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><pre>javascript:

var urlSuffix = '?' + Math.random ();
var imageURLs = {};
Array.prototype.forEach.call (document.querySelectorAll (&quot;img&quot;), function (e) {
  imageURLs[e.src + urlSuffix] = true;
});

Promise.all (
  Object.keys (imageURLs).map (function (u) {
    return new Promise (function (ok) {
      var img = new Image;
      img.src = u;
      img.onload = ok;
    });
  })
).then (function () {
  var imageSizes = {};
  Array.prototype.forEach.call (performance.getEntries (), function (p) {
    if (imageURLs[p.name]) {
      imageSizes[p.name] = p.transferSize;
    }
  });

  console.log (imageSizes);
});</pre><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">同じ起源</anchor>でないと <n xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">0</n> になる。</p><pre>javascript:

var imageURLs = {};
Array.prototype.forEach.call (document.querySelectorAll (&quot;img&quot;), function (e) {
  imageURLs[e.src] = true;
});

Promise.all (
  Object.keys (imageURLs).map (function (u) {
    return fetch (u, {headers: <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&quot;cache-control&quot;, &quot;no-store,no-cache&quot;</anchor>}).catch (function () { });
  })
).then (function () {
  var imageSizes = {};
  Array.prototype.forEach.call (performance.getEntries (), function (p) {
    if (imageURLs[p.name]) {
      imageSizes[p.name] = p.transferSize;
    }
  });

  console.log (imageSizes);
});</pre></body></html>