Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
1 vote
0 answers
213 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
28 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
115 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
2 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
93 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
731 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
627 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
151 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,986
0 votes
0 answers
473 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
882 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
143 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
0 votes
0 answers
676 views

I have a simple project in which I've included a modal component that can be closed by the browser's back button. When a modal is opened, a hash appears in the URL. If the user clicks the back button, ...
Ali Ehyaie's user avatar
  • 1,334

15 30 50 per page
1
2 3 4 5
11