Exiting Apps
Expected behavior for the EXIT functions from the application:
- If there is referrer url and it is not the same as the current location => window.location.assign(document.referrer)
- If there is referrer url and it is same as the current location => window.close()
- If there is no referrer url => window.close()
Example Code
if(document.referrer == "") { window.close(); } // if there is no refferer url, close the app
else{ window.location.assign(document.referrer) } // if there is a refferer url, go back to referrer page