Skip to main content
2 votes
1 answer
118 views

We are using hash-based routing in an Angular SPA. There are two kinds of navigation I want to handle differently: Browser Back/Forward buttons → Listen to the native popstate event and handle this ...
Jaga's user avatar
  • 127
1 vote
0 answers
232 views

I'm using history.pushState to change the URL programmatically without any user interaction (like a button click). This works fine in Chrome and some other browsers, but in Firefox, when I press the ...
Dimuthu Pinsara's user avatar
1 vote
0 answers
31 views

I'm developing a website with page transitions (similar to AJAX) using history's API popstate event. On the website, I also use HTML anchor links <a> with the href value only containing a ...
Mathieu Préaud's user avatar
1 vote
0 answers
117 views

I use pushState to change url. But with this method of changing the URL, I can't normally work with back and forward. Is Is there a way to make pushState work with back/forward just like with routing ...
uiHellen's user avatar
  • 147
3 votes
0 answers
2k views

I'm developing a Next.js application using the App Router. I want to listen to the popstate event and call the preventDefault method on the event object to display the browser warning popup before the ...
hayata_suenaga's user avatar
0 votes
1 answer
95 views

I'm trying to implement a confirmation modal that appears when the user tries to navigate away from a page with unsaved changes. The modal correctly appears when the browser's back button or a "...
27Lia's user avatar
  • 1
1 vote
2 answers
2k views

I have a more complex setup, but have boiled my hook down to the most minimum example: import { useEffect } from "react"; const useUnsavedChangesAlert = () => { useEffect(() => { ...
Luke Sharon's user avatar
1 vote
1 answer
756 views

I have noticed that in the latest Chrome version(122), window.popstate event does not fire when we click the browser back/forward multiple times. I am trying to prevent the back/forward click in my ...
Mohd Anzal's user avatar
1 vote
1 answer
632 views

I have something like a single page web application. To handle a back button click from the user I use the 'popstate' event Here it is: window.addEventListener('popstate', function () { ...
Sonnar123's user avatar
0 votes
0 answers
1k views

I have something like a single page web application. To handle a back button click from the user I use the 'popstate' event: I have something like a single page web application. To handle a back ...
Sonnar123's user avatar
1 vote
0 answers
152 views

I created an app with ESRI ArcGIS Web App Builder. Now I want to ask the user if he wants to leave the page any time he clicks the forward or back button of the browser or if he refreshes the page. I ...
slevin's user avatar
  • 3,996
0 votes
0 answers
476 views

I have registered the popstate event as a listener in JS, but only in Safari on My Mac it does not fire when the back button is pressed; in Chrome and Firefox it fires. My Safari version is 16.3 (...
y.dai's user avatar
  • 35
0 votes
1 answer
1k views

I am trying to build a global navigation system for my React app where I store the states in local storage and URL. now when I need to go back, the first time when I click back it works. I restore the ...
afsana mimi's user avatar
1 vote
1 answer
887 views

Let say, visitor visited my website example.com and then visited other website (maybe by clicking any link of my webpage or maybe manually typing to address bar) in same tab and then he pressed ...
Mehul Kumar's user avatar
0 votes
0 answers
145 views

I am confused on the working fuction of popstate. Example.com (Clicked href) -> Google.com (Pressed Back) -> Yahoo.com (OR) Example.com (Clicked href) -> Google.com (Pressed Back) -> ...
Mehul Kumar's user avatar

15 30 50 per page
1
2 3 4 5
11