635 questions
1
vote
0
answers
213
views
history.pushState without user interaction causes popstate not to trigger in Firefox – how to fix this?
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 ...
-1
votes
1
answer
45
views
Shallow Routing throws 404 when typing address directly or reloading item url. How to fix this?
Shallow routing works well when clicking on an item
Shallow routing throws 404 when typing item url directly
Link to Stackblitz that shows the issue
src/routes/(news)/+layout.svelte
<script lang=&...
1
vote
0
answers
40
views
Is it possible to use the back button to go back to the previous page from a page that was moved by location.href without user action?
Here is 1.html
<!DOCTYPE html>
<html>
1
<script>
let time = 0;
setInterval(() => {
if (time === 500) location.href = '/2.html';
time++;
}, 1);
</...
0
votes
2
answers
250
views
pushState in sveltekit shallow routing is not setting page.state.cart at all
I have a sveltekit app. in one page -cart.svelte- I press a button to go to page where I choose if the order for pickup or delivery -ordertype.svelte- but I lost the cart content because it is a ...
0
votes
0
answers
139
views
Is it possible to accurately define a structure clonable type in TypeScript
Aka define the set of all possible values that can be passed through structured clone algorithm (mdn, html spec, structuredClone).
It'd be super useful to constrain types that has to be passed through ...
1
vote
1
answer
118
views
When does the popstate fire? What is it dependent on?
I found that popstate fires when the user presses back or forward button. But that does it mean it is the default behaviour of the browser. Suppose a website doesn't use SPA, clicking on a link loads ...
0
votes
0
answers
136
views
How to detect if a URL has changed in TMS WEB Core?
I have a TMS WEB Core application with code all over the place that changes the URL via the window.history.pushState function.
Is there a way I can detect when the URL has changed?
Let's say for ...
0
votes
2
answers
398
views
Replacing history.pushState to send events (getting Ilegal invocation error)
I have a lib which is added in a SPA project which uses router.push(which will eventually call window.history.pushState) to make the url changes.
However I need my lib to be able to listen to these ...
0
votes
1
answer
528
views
React- adding query param with pushState adds trailing slash before params (without react router)
I'm trying to manipulate my query params directly without any library (like react-router- because i don't need them now).
The problem is when i try to add query params using this codes:
let url = new ...
0
votes
1
answer
141
views
I need to prevent showing previous pages from my django app
Even after I logged out I'm still able to see my previous pages how to prevent the browser from showing this?
I tried this piece of JavaScript code .
Note: I used template inheriting and templates ...
0
votes
1
answer
89
views
Chrome Extension scripts: simpler way to listen for any type of URL visit?
Update: This was an oversight on my behalf - Tabs.onUpdated.addListener does indeed fire on all mentioned events, I just had a hidden guard clause that was blocking it from firing on pushstate/...
0
votes
3
answers
342
views
prevent javascript to encode url
I am trying to change url with pushstate in java script and my url doesn't have any space or bad character for url but java script encode it and add some character in it.
my code is:
name= name....
0
votes
1
answer
55
views
Get active a tags switching to work with pushState?
I have a single page website and I am using an ACTIVE class on the nav to highlight the links in the NAV.
The javascript to make nav links active:
$(document).ready(function () {
$('.inner-nav li ...
0
votes
1
answer
142
views
history.pushState on sub pages in an Angular.js application
I have a blank Angular.js 6 application that uses PathLocationStrategy for routing, and when on a subroute (e.g. /test) and executing the following:
history.pushState({}, '', '#abc');
window....
2
votes
1
answer
767
views
Why does history.pushState() not get respected when using the built in browser back button in Safari 16.* and Chrome 107.0.5304?
I've found that in these versions of Safari and Chrome, pushing a new state value into the browsers history with no user input will behave unexpectedly. It will correctly update the state. You will be ...