aura:locationChange

Indicates that the hash part of the URL has changed.
This event is automatically fired when the hash part of the URL has changed, such as when a new location token is appended to the hash. The aura:locationChange event is handled by a client-side controller. A component can have only one <aura:handler event="aura:locationChange"> tag to handle this event.
<aura:handler event="aura:locationChange" action="{!c.update}"/>
This client-side controller handles the aura:locationChange event.
({
    update : function (component, event, helper) {
        // Get the new location token from the event
        var loc = event.getParam("token");
        // Do something else
    }
})
The aura:locationChange handler contains these required attributes.
Attribute Name Type Description
event String The name of the event, which must be set to aura:locationChange.
action Object The client-side controller action that handles the event.
The aura:locationChange event contains these attributes.
Attribute Name Type Description
token String The hash part of the URL.
querystring Object The query string portion of the hash.