[whatwg] onForward and onBackward event and enable/disable Forward and Backward buttons.

Biju bijumaillist at gmail.com
Sat Apr 16 11:02:18 PDT 2011

On Sat, Apr 16, 2011 at 11:14 AM, Ashley Sheridan
<ash at ashleysheridan.co.uk> wrote:
> Couldn't that be badly abused by sites that wanted you to force you to use their navigation
> rather than allow you to use back and forwards buttons on your browser?
This proposal wont give any more facility to website than they already have now.
To reduce abuse, we could make it not trigger onBackward and onForward
events if user pulled the history list and selected one from the list.
ie, onBackward and onForward events should only trigger if user
directly hit  Backward and Forward buttons to move +1 or -1 position
in the history list. Additionally history.go() called from javascript
also should not trigger onBackward and onForward events.

> Wouldn't  onbeforeunload() work in this case anyway?
That will do a modal prompt, that need another user action, which is
not good. Then the page also dont know how  onbeforeunload() got
triggered, ie by tab/window close,  Backward/Forward button click,
clicking links, etc (we only care about Backward/Forward button click
in this case). Also webpage wont be able to navigate to any other page
or do a Ajax page change that STAYS and visible to user in
onbeforeunload() event.

More information about the whatwg mailing list