Explorar el Código

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

TIANYONG hace 4 meses
padre
commit
f1ca843890
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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() {
       window.onload = function() {
         console.log('加载完成')
         console.log('加载完成')
-        let timing: any = performance.getEntriesByType('navigation')[0];
+        let timing: any = performance.getEntriesByType('navigation')[0] || {};
         const { domainLookupEnd, domainLookupStart, connectEnd, connectStart, responseStart,
         const { domainLookupEnd, domainLookupStart, connectEnd, connectStart, responseStart,
           requestStart, responseEnd, domInteractive, loadEventStart, domContentLoadedEventEnd,
           requestStart, responseEnd, domInteractive, loadEventStart, domContentLoadedEventEnd,
           fetchStart, secureConnectionStart, transferSize, encodedBodySize,
           fetchStart, secureConnectionStart, transferSize, encodedBodySize,