Hi @Raghunandan Kumbhar ,
To detect URL changes in SharePoint Server 2019/Subscription Edition using SPFx, you can monitor client-side URL modifications by combining the popstate
event with monkey-patched history methods. Here is the code for reference
private handleUrlChange = (): void => {
const currentUrl = window.location.href;
if (currentUrl !== this.previousUrl) {
console.log(`URL changed from ${this.previousUrl} to ${currentUrl}`);
// Add custom logic here (e.g., trigger updates, log changes)
this.previousUrl = currentUrl;
}
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.