MCPcopy Index your code
hub / github.com/zxlie/FeHelper / getResourceTiming

Function getResourceTiming

apps/page-timing/content-script.js:112–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111 // 获取资源加载性能数据
112 function getResourceTiming() {
113 const resources = performance.getEntriesByType('resource');
114 return resources.map(resource => ({
115 name: resource.name,
116 entryType: resource.entryType,
117 startTime: resource.startTime,
118 duration: resource.duration,
119 transferSize: resource.transferSize,
120 decodedBodySize: resource.decodedBodySize,
121 encodedBodySize: resource.encodedBodySize,
122 dnsTime: resource.domainLookupEnd - resource.domainLookupStart,
123 tcpTime: resource.connectEnd - resource.connectStart,
124 ttfb: resource.responseStart - resource.requestStart,
125 downloadTime: resource.responseEnd - resource.responseStart
126 }));
127 }
128
129 // 获取核心Web指标
130 function getCoreWebVitals() {

Callers 1

content-script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected