October 2017
Intermediate to advanced
370 pages
8h 57m
English
There's another issue to consider here. When the user clicks a link, we are essentially loading a new document into the PWA shell, but the URL hasn't changed: We've lost the navigation history. If the user clicks the browser's back button, they'll be brought to the last URL they visited before the PWA, rather than the most recent content they visited within the PWA. Equally bad, if the user tries to share the URL of the current page, they'll end up sharing the default pwa.html URL, rather than linking directly to the content they want to share.
We can fix this by using the HTML5 History API. This API allows us to manipulate the browser URL. We can use the history.pushState() method to:
Read now
Unlock full access