Chrome-SP-Editor
Chrome-SP-Editor copied to clipboard
Unable to load _spPageContextInfo in popup.html
I am getting below error while loading pagecontentinfo in popup.html
Thanks @sankarkumar23 I will have a look!
@sankarkumar23 which page in SharePoint you got this?
Any SharePoint page. It never worked for me.. the popup.html is not showing the properties. Looks like JSON.stringfy resulting in circular references which is causing the issue.
Still cannot repro this. Is your SharePoint online/onprem? Which chrome version you are using?
I am trying on SharePoint Online. Chrome version - 94.0.4606.71
I noticed it was working fine for some site collections and not for some. It appears its not working for certain site templates.
thanks @sankarkumar23 ! Could you try to check what type of SiteCollection is it? That would help me to discover the reason and provide a fix. Cheers!
@tavikukko - Thank you for this extension. I use this almost everyday.
One of the features I like the most is the extension popup which provides links to various SharePoint (system?) pages. That popup works on all pages, however I have seen it not working in the modern list page i.e. if we navigate to any modern list (/sites/contoso/lists/listname
) and click on the extension, we do not see the links loading.
We see the below
and the error message is similar to the one shared originally earlier
Potential fix
It looks like the dataSyncClient
property of the _spPageContextInfo
is the culprit which is preventing JSON.stringify
to run in the getContext
function.
So if we remove the dataSyncClient
property then JSON.stringify
runs fine. A function like below can be used
var removePropertyFromObject = function (propertyName, objectToBeProcessed) {
let { [propertyName]: _, ...objectWithoutProperty } = objectToBeProcessed;
return objectWithoutProperty;
}
removePropertyFromObject("dataSyncClient", _spPageContextInfo)
But when this issue was reported, the property causing the error was different (as per the first screenshot when the issue was raised). So, not sure if the fix I have suggested is the right one?
I am using Edge (chromium) version 108.0.1462.54 and 110.0.1556.0 dev .
Happy to provide more information if needed.
Hi @anoopt Thanks for the fix, I'll apply it and test if it work! Thanks!
The fix worked, it will be part of the next release, which is in Review at the Chrome Store. Thanks and happy new year!