Shantha Kumar T
Today we will see how to get the current context information from the Modern Page. In Classical pages and other than modern site pages, we can get the current web and user context information using the _spPageContextInfo variable.
There is a workaround is available and that too has come from SharePoint. We have to use the full Modern Page URL to send the request along with “as=json” as a query string.
Format of the Request URL:
http://domaoin.sharepoint.com/sites/name– If the modern page is the home page of the site
To test this, navigate to the modern site page. Then open the browser console and paste the below code snippet,