、私はMDNにそのことについて話すの文書が見つかりました:
https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/encodedBodySize
方法は存在しますが、ブラウザにはまだそれを実装しないでください。ここ
MDNからコードのサンプル:
function log_sizes(perfEntry){
// Check for support of the PerformanceEntry.*size properties and print their values
// if supported.
if ("decodedBodySize" in perfEntry)
console.log("decodedBodySize = " + perfEntry.decodedBodySize);
else
console.log("decodedBodySize = NOT supported");
if ("encodedBodySize" in perfEntry)
console.log("encodedBodySize = " + perfEntry.encodedBodySize);
else
console.log("encodedBodySize = NOT supported");
if ("transferSize" in perfEntry)
console.log("transferSize = " + perfEntry.transferSize);
else
console.log("transferSize = NOT supported");
}
function check_PerformanceEntries() {
// Use getEntriesByType() to just get the "resource" events
var p = performance.getEntriesByType("resource");
for (var i=0; i < p.length; i++) {
log_sizes(p[i]);
}
}