ソースを参照

feat(window.loaded): Add new metric. (#14965)

factor2
Hristo Terezov 1年前
コミット
4d79bbb5d8
コミッターのメールアドレスに関連付けられたアカウントが存在しません
2個のファイルの変更9行の追加0行の削除
  1. 5
    0
      index.html
  2. 4
    0
      react/index.web.js

+ 5
- 0
index.html ファイルの表示

@@ -69,6 +69,11 @@
69 69
 
70 70
         window.indexLoadedTime = window.performance.now();
71 71
         console.log("(TIME) index.html loaded:\t", indexLoadedTime);
72
+        window.addEventListener('load', function() {
73
+            window.loadedEventTime = window.performance.now();
74
+            console.log("(TIME) window loaded event:\t", loadedEventTime);
75
+        });
76
+
72 77
         // XXX the code below listeners for errors and displays an error message
73 78
         // in the document body when any of the required files fails to load.
74 79
         // The intention is to prevent from displaying broken page.

+ 4
- 0
react/index.web.js ファイルの表示

@@ -51,6 +51,10 @@ globalNS.connectionTimes = {
51 51
     'index.loaded': window.indexLoadedTime
52 52
 };
53 53
 
54
+window.addEventListener('load', () => {
55
+    globalNS.connectionTimes['window.loaded'] = window.loadedEventTime;
56
+});
57
+
54 58
 document.addEventListener('DOMContentLoaded', () => {
55 59
     const now = window.performance.now();
56 60
 

読み込み中…
キャンセル
保存