Riff / Built on the open web / Platform

History

Back closes Now Playing, and the Listen app navigates without a page load.

Now Playing on a phone: the cover, the title and artist, a seek bar, and the play controls
Opening this view pushed a history entry, so the phone's Back gesture closes it instead of leaving the page.

How Riff uses it

Opening Now Playing pushes a history entry without changing the address, so Back closes the dialog. Closing it any other way pops that entry. The Listen app pushes an entry with the new address for each view it swaps in and re-renders on popstate, spreading the existing state so the Interactivity API's session id survives.

Why

A lost session id would make the Interactivity runtime reload the page on Back and end the music.

Where

Links open the source at the commit this page was published from.

Reference: History on MDN.