Compare commits

...

2 Commits

Author SHA1 Message Date
Hristo Terezov
4d79bbb5d8 feat(window.loaded): Add new metric. (#14965) 2024-08-01 12:43:25 -04:00
Saúl Ibarra Corretgé
e31aff5afd Revert "feat(external-api) add deployment information to ready event"
This reverts commit 6727004930.
2024-07-31 17:44:56 +02:00
3 changed files with 10 additions and 6 deletions

View File

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

View File

@@ -1126,12 +1126,7 @@ class API {
this.notifyBrowserSupport(isSupportedBrowser());
// Let the embedder know we are ready.
this._sendEvent({
name: 'ready',
// XXX: Here we are using window.config since this is fired really early.
info: window.config.deploymentInfo
});
this._sendEvent({ name: 'ready' });
}
/**

View File

@@ -51,6 +51,10 @@ globalNS.connectionTimes = {
'index.loaded': window.indexLoadedTime
};
window.addEventListener('load', () => {
globalNS.connectionTimes['window.loaded'] = window.loadedEventTime;
});
document.addEventListener('DOMContentLoaded', () => {
const now = window.performance.now();