Using SPFx extension (application customizer) added JS files to all SharePoint pages (including modern pages), something like mentioned in below blog:
I am using some custom JavaScript logic which runs in almost all pages, I am using _spPageContextInfo
object extensively, it works fine in classic pages.
In modern page I get _spPageContextInfo
is undefined.
Are there any alternative ways I can get _spPageContextInfo
object value using normal JavaScript in modern pages.
In SPFx we can use this.context.pageContext.legacyPageContext
but not in JavaScript
_spPageContextInfo
in your code? Maybe we can suggest you another way to get the same in SPFx.legacyPageContext
in your code?