W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2011

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

From: Ashley Sheridan <ash@ashleysheridan.co.uk>
Date: Sat, 16 Apr 2011 16:14:07 +0100
Message-ID: <1302966847.3322.12.camel@localhost.localdomain>
On Sat, 2011-04-16 at 11:12 -0400, Biju wrote:

> Hi,
> 
>    setInterval(function(){location='#'+(1*new Date())},0)
> 
> At least in Firefox 4 above code make entire history filled with
> current url with different hash.
> And hence already now a website can make Backward/Forward button useless.
> 
> ---------------
> 
> When I am on a web application, my naturally tendency to hit back
> button to go back to the previous screen layout. But many times this
> screw up an Ajax application as it may totally navigate away from the
> application page.
> 
> So I want to suggest we should add onBackward and onForward events for
> a page which will be triggered when user click the Backward  or
> Forward button. This will be triggered before onpagehide and event
> handler will be able to cancel the event if needed.
> Additionally there should be also a felicity to enable/disable Forward
> and Backward buttons.
> Also a way for website to know whether currently the Forward and
> Backward buttons are visible, as the page may have opened without the
> browser chrome toolbars.
> 
> Cheers
> Biu


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? Wouldn't onbeforeunload() work in this case
anyway?

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk
Received on Saturday, 16 April 2011 08:14:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:03 GMT