We are trying to develop an extension for site Analytics in modern SharePoint site. In the applicationcustomizer.ts file, we have included a code fragment which uses window.onload function. But eventhough the site is fully loaded the function is never executed.
We like to measure the load time for the site, once it finishes loading the site including every large images. Is there any suggested way for this functionality in SharePoint modern environment.
Not sure, but could it be that the window is already loaded when the extensions starts running? If you want some feedback for loading times in SharePoint, check out the Page DIagnostics Chrome extension that Microsoft developed. I've found it quite useful to track page loading time.