Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One-page HTML5 Web Application Should Not Have A Back Button?

As I am working on an HTML5 web application working like a desktop app, I am wondering if the browser back button should be usable or not.

First, inside my app. As the design is close to a desktop application, I never change the url, so there is no history at all, it's a one page application.

Second, outside my app. I would tend to ask the user when she hits previous in history if she wants to leave the application as the normal behavior is to go to a previous URL, which I think I should not prevent.

What do you think ? Is this approach reasonable?

Thanks!


After comments:

  • When there is a back button on the broser page, this button should behave correctly. I agree.

  • But if there is no back button, then it can make the web application look more like an application (and less like a web site). For example Google applications in chrome (e.g. mail, calendar) when opened in a dedicated window does not display any back button.

I will look more into the google solution to create a web app in a separated window running on chrome. I am wondering if it can be generalized.


Examples found:

https://www.draw.io/ - When going back, opens a dialog asking the user to choose to leave the app. I find that neat.

like image 277
unludo Avatar asked Feb 01 '12 21:02

unludo


2 Answers

(Per @NathanArthur's advice, posting this as an answer.)

If the view changes then the user will expect the back button to take them back to the previous view. Breaking behavior that users expect is a good way to make them unhappy. Modern browsers have a great API for this.

like image 117
Jordan Running Avatar answered Oct 28 '22 15:10

Jordan Running


Why, not pushing States to the History? I would really recommend this to you, because you should try not to break normal behavior of users, they will always try to push that button, if they clicked something by accident. You could use History.js.

Or is there a reason not to use the history ?

like image 30
herbertp. Avatar answered Oct 28 '22 14:10

herbertp.