Hide ?force=1 in the URL using History API
Opened this issue · 5 comments
Device.js lets you force loading the exact version of the app to load through the combination of ?device=deviceClassId and ?force=1 GET parameters. However, these could be hidden to give a cleaner URL.
actually redirecting is bad pracice. t'll be greate just returning a value = desktop | phone | tablet. So the script is useless in most cases
@englishextra here redirection only happens if you're on the wrong version of the page. but yes, client-side redirection definitely has performance overhead.
👍 our team would appreciate this
So from what I understand the URL would be such as "www.myurl.com?device=deviceType" ?
If yes, then +1.
Cleaner URL for the user means an easier URL to share (ie. via email, chat, telephone, & so on) & probably a better understanding of what's happening - for those users who actually "observe" URLs, which I believe is quite common.
just replace with return 1 - this is in my case
Oh thanks for the script - really handy - use it in all projects