This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20659 - A corresponding "pushstate" event would be very useful in some cases (e.g. read some of https://duckduckgo.com/?q=onpushstate ). My particular usecase is for userscripts for sites that use the HTML5 H [...]
Summary: A corresponding "pushstate" event would be very useful in some cases (e.g. re...
Status: RESOLVED NEEDSINFO
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 enhancement
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-14 05:57 UTC by contributor
Modified: 2013-04-12 23:20 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2013-01-14 05:57:04 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html
Multipage: http://www.whatwg.org/C#history-traversal
Complete: http://www.whatwg.org/c#history-traversal

Comment:
A corresponding "pushstate" event would be very useful in some cases (e.g.
read some of https://duckduckgo.com/?q=onpushstate ). My particular usecase is
for userscripts for sites that use the HTML5 History API, where some
non-invasive way of detecting "a new logical page has loaded", so that DOM
changes can be applied, is necessary.

Posted from: 75.84.96.11
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17
Comment 1 Chris Rebert 2013-01-14 06:00:37 UTC
Argh. Correction to my comment: s/can be applied/should be reapplied/
Comment 2 Ian 'Hixie' Hickson 2013-03-08 23:41:00 UTC
You know when you've called pushstate, since you just called it...

I don't understand the use case here. Can you elaborate? Generally we don't provide events that fire when scripts do something, since it's not needed — if you for some reason don't control all the code that you're running, you can at least just override the things you want to hook and catch them that way (e.g. override pushState with your own method).
Comment 3 Ian 'Hixie' Hickson 2013-04-12 23:20:51 UTC
Chris, please reopen this bug if you can provide the clarifications requested in comment 2, thanks.