[Question] Unable to redirect url using Page.route
See original GitHub issuehi, i tried to make a redirection on XHR on another url unsucessfully here is what i tried unsuccessfully:
await page.route('https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2@1.5x.png', (request) => {
request.continue({url: 'https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikinews-logo_sister@2x.png'});
}
await page.goto('https://www.wikipedia.org/');
and
await page.route('https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2@1.5x.png', (request) => {
request._url = 'https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikinews-logo_sister@2x.png';
request.continue();
}
await page.goto('https://www.wikipedia.org/');
Could you provide me a good way to do it?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
javascript - Angular 9 : Unable to redirect to a specific route in ...
Now I am getting redirected to the external payment page where I can make the payment or cancel the transaction. If I click...
Read more >How to Use JavaScript to Redirect a URL - Semrush
Learn 3 of the most common ways to redirect a URL using JavaScript the location object: setting a new window.location.href property, ...
Read more >Redirections in HTTP - MDN Web Docs - Mozilla
URL redirection, also known as URL forwarding, is a technique to give more than one URL address to a page, a form, or...
Read more >How to redirect a URL for a domain? - Namecheap
I am moving my site from one server to another and will do a permanent either A record or redirect later, and I...
Read more >Redirects and Google Search | Documentation
If you just want to send users to a different page temporarily, use a temporary redirect. This will also ensure that Google keeps...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi! Thank you for the solution! It works great for me while running chromium and firefox, but does not work for WebKit 😦 Do you know what could be the problem? ps: it not the cors problem, but i tried adding header ‘Access-control-allow-origin’: ‘*’, Playwright 1.5.2 WebKit 14.0 Ubuntu 18.04
There is a bug in WebKit implementation of fulfill, I’ll have a look.