Now that aura:locationChange event no longer works with the new URL format ( effective from Summer '18 release. Reference here), is there a way to detect a change in the URL using lightning events or any other mechanism?
handleLocationChange: function (component, event, helper) {
var location = event.getParam("token");//this returns null now with the Summer '18 release.
if (location != '/n/my_fav_URL') {
//do some {!stuff}
} else {
//do some {!NOT(stuff)}
}
}
I see that lightning:navigation and pageReference object don't really provide a straight way to detect the URL changes like aura:locationChange did.