I need to run some JS script on each page in modern SharePoint online communication site so I created SPFx extension and added to the site.

One of the things I need to do is to get page loading time (its used to be done with g_duration in classic site ), client browser and client IP address. Anybody knows how I can do it in SPFx extension?

I started looking to PnP JS but have not found how to do it.

1 Answer 1


You could try to use Page Diagnostics for SharePoint tool, it's a tool to analyze SharePoint Online modern and classic site pages against a pre-defined set of performance criteria. You will see the page load time in this tool.

Use the Page Diagnostics for SharePoint tool

  • I need it to a part of my extension, so info captured and dealt with every time user opens any page Jan 13, 2021 at 11:39
  • If there is no constant to get the page load time, then we cannot get the accurate load time in the spfx extension, and the extension will not load at the same time as the page.
    – Amos
    Jan 14, 2021 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.