[whatwg] Do we really need history.clearState()?
beidson at apple.com
Thu Nov 12 13:16:51 PST 2009
I should've responded to this more directly:
On Nov 12, 2009, at 12:00 PM, Justin Lebar wrote:
> I think the use case I proposed is much better served by something
> like history.truncate(numBefore, numAfter), which would remove all but
> the numBefore entries before the current entry and the numAfter
> entries after the current entry. We'd subject this to the same-origin
> policy, of course, and stop removing entries in a direction as soon as
> we encountered an entry from another origin.
The History object is - quite purposefully - very limited in scope and abilities. Today, it gives the ability to navigate back and forward a number of steps. Period.
The pushState() API adds a very limited way of adding new items programatically. clearState() also adds the ability for a script to remove entries, but only ones that it added. Period.
Same-origin policy be damned, I really don't like the idea of a script being able to remove items that it didn't add.
As I said in my previous reply, I think it might be useful to give a more fine-grained version of "clearState()", but that could always be added later if there's demand. And I still think it should be limited to affecting the string of the Document object's entries.
More information about the whatwg