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)?

1 Answer 1


This should work:


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

  • 1
    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
    Commented Aug 6, 2019 at 6:04

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.