SharePoint Online/2019 javascript/spfx click/popstate not working
Are you working with SharePoint 2019?
Maybe making some SPFx Extensions?
popstate not working?
click not working?
MutationObserver not working?
well, take a look at this
As you can see, Microsoft are intercepting every click in the page, while stopping any bubbling.
Therefor, any window/document/body onclick event will not work, in case you are trying to globally catch it.
Same for popstate or MutationObserver.
*Note - on SPO it seems that popstate event works.
Solution - make an interval to keep watching href change:
Usage:
My Scenario:
I've added some scripts via Extension, but when user changed a page, I needed to re-run those scripts, like page load/ready.
*Note - this is not really page load/ready, just a notification that the page has changed location
Upgrade - run it aslo 1st time, so that xOnLocationChangeFunctions can be used for 1st time also
go to buy google reviews for know more
ReplyDelete