Browse Source

feat: 部分手机performance.getEntriesByType('navigation')获取为空

TIANYONG 2 weeks ago
parent
commit
f1ca843890
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/page-instrument/App.tsx

+ 1 - 1
src/page-instrument/App.tsx

@@ -146,7 +146,7 @@ export default defineComponent({
        */
       window.onload = function() {
         console.log('加载完成')
-        let timing: any = performance.getEntriesByType('navigation')[0];
+        let timing: any = performance.getEntriesByType('navigation')[0] || {};
         const { domainLookupEnd, domainLookupStart, connectEnd, connectStart, responseStart,
           requestStart, responseEnd, domInteractive, loadEventStart, domContentLoadedEventEnd,
           fetchStart, secureConnectionStart, transferSize, encodedBodySize,