You cannot know for sure. All you can find out is that the navigation event was received from the application (click the link processed by Sammy, the form is submitted, the action is in your JS ...), or if the navigation event came from the "external" Back button, Forward button, change URL string, ...
Flunch
source share