674 questions
0
votes
0
answers
27
views
Using `wx.miniProgram.postMessage`, on higher versions of iOS, navigating back will directly close the WebView container
Page A (H5) navigates to another project’s Page B (H5) via window.location.href. On Page B, an internal route (push) takes the user to Page C. When tapping the back button on Page C, on higher ...
0
votes
0
answers
128
views
How to solve Open Redirect vulnerability
In a webapp we are trying to solve an Open Redirect vulnerability.
The code is like this:
window.location.href = DOMPurify.sanitize(data.href);
Which apparently is vulnerable. One recommended solution ...
0
votes
0
answers
47
views
How to include all parameters in the URL captured in JavaScript, to add full URL to a pre-populated email [duplicate]
I can successfully pre-populate an email from a button click with the first part of the page URL, and the first parameter in the URL, but it's cutting off after that. I have multiple parameters in the ...
1
vote
2
answers
57
views
Show only elements with a specific id (determened in the url)
I've been working on a coding project and I have been trying to have multiple "pages" in one html file (e.g. awsomesauce.com/page.html#videos and showing only the videos section) while ...
-2
votes
1
answer
70
views
How can I change window.location? [closed]
According to the locale value, language information comes after the domain name in the URL. For example, when it is tr, it is http://127.0.0.1:3000/tr/home. When it is English, it is http://127.0.0.1:...
-2
votes
2
answers
177
views
window.location.href.match not working for homepage
I'm creating an eshop on one eCommerce platform (Shoptet) a I'm trying to hide few elements only on homepage but I still want to see them on subpages. These elements have same classes.
My script looks ...
1
vote
1
answer
771
views
useLocation location members are empty within HashRouter
When using a HashRouter, and within a component using useLocation, there is a discrepancy between the window.location object and the location object from useLocation.
As I am writing this I have ...
0
votes
0
answers
46
views
window.location.href Loads WHOLE URL When INCOMPLETE URL Input is Submitted by Form
When text is entered into this form, it then loads a webpage with that typed text appended at the end of my domain name, to create the full page url. (Incidentally, it also disables the typed Enter ...
0
votes
1
answer
224
views
NextJS Exports error, location not defined
I have NextJS app, where I declare Pages to be client side using "use client" at the top of the file. When I try to build said application, I get errors stating
Error occurred prerendering ...
0
votes
1
answer
2k
views
Why won't Playwright work when triggering window.location.href in the Firefox project?
I have a React component with an onClick listener that looks like this:
<button
className='h-10 min-h-[2.5rem] m-2 rounded-lg border-2 text-white bg-violet-400 border-white'
id='logout-...
0
votes
2
answers
2k
views
how to show search result in another page using javascript
I wanted to show the result of the form into another page. I tried redirecting the result using the window.href.location and localStorage but it's not redirecting it to another page. I used the click()...
0
votes
1
answer
50
views
Add form input to URL in a new tab
I'm currently using the below to add a user's input to a URL but it opens in the same window. I've tried window.open to get the link to open in a new tab with no luck. I've also tried adding _blank ...
1
vote
0
answers
348
views
window.location.assign() not working in axios "then" in mobile browsers in production
What I want my nextjs/react code to do:
When User clicks "Submit" button, a new tab is opened, then an axios request is sent that returns a response containing a URL generated by the API. I ...
0
votes
2
answers
127
views
Looping in window.location
I am getting lat and lng from sessionStorage and I want to send it to browser with window.location but i get to a infinity loop.
var lat = sessionStorage.getItem('lat');
var lng = ...
5
votes
1
answer
461
views
Inconsistent behavior of the URL constructor between Safari and Chrome, when working with custom URL schema
I am trying to figure out why there is a difference between two identical URL constructor calls in Safari and Chrome
Here is the example from Safari:
And here is an example from Chrome:
I'm working ...