1

In SPFx/Typescript we can use this.context.pageContext.legacyPageContext to get the old _spPageContextInfo. But how can I get hold of this if I am just working in the browser console on a modern page (i.e. without Typescript or SPFx)?

2

This should work:

window.spModuleLoader._bundledComponents["b6917cb1-93a0-4b97-a84d-7cf49975d4ec"].PageManager._instance.pageContext.legacyPageContext

But I'd recommend adding an application customizer that defines all the required context variables globally in your own namespace.

  • Thanks! Had to look up the GUID. For anyone else curious: The "modern" pages are delivered by using the Site Pages web scoped feature (B6917CB1-93A0-4B97-A84D-7CF49975D4EC) – rlv-dan Aug 6 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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