DEV Community

Discussion on: Is there any way to detect if a user "can go back" in PWAs (desktop PWA most specifically)

Collapse
 
okbrown profile image
Orlando Brown • Edited

I have come a across this issue before in another project.

On document.referrer it holds the previous page, if it contains a URL with dev.to you can then use window.history.back() (other wise prevent it going back as to not leave the page/app unless required)

Thing I can't remember is, ain't there a history list API that returns back all the previous pages you were at?