firefox: page.url() does not show url fragments.
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 5.5.0
- Platform / OS version: MacOS
- URLs (if applicable): https://en.wikipedia.org/wiki/Puppeteer
- Node.js version: v14.15.1
What steps will reproduce the problem?
Please include code that reproduces the issue. (As pointed out by @andersk here.)
const puppeteer = require("puppeteer");
(async () => {
const browser = await puppeteer.launch({ headless: false, slowMo: 200, product: "firefox" });
const page = await browser.newPage();
await page.goto("https://en.wikipedia.org/wiki/Puppeteer");
await page.waitForSelector("a[href='#References']", { visible: true });
await Promise.all([
page.waitForNavigation(),
page.click("a[href='#References']"),
]);
console.log(page.url());
await browser.close();
})();
What is the expected result?
page.url() should show fragment URL.
For eg: https://en.wikipedia.org/wiki/Puppeteer/#References
(When we run with chrome)
What happens instead?
page.url() does not show URL with fragment.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Match a Fragment identifier in a URL - Mozilla Discourse
One thing you could do is not display the page based on its current fragment identifier. There are several ways to achieve that,...
Read more >Firefox: page does not reload if i select the address bar and ...
If you've got fragments within your URL, Firefox won't refresh but will simply try and take you to the location of the ID...
Read more >Boldly link where no one has linked before: Text Fragments
Text Fragments let you specify a text snippet in the URL fragment. When navigating to a URL with such a text fragment, the...
Read more >URI fragment - Wikipedia
The fragment identifier introduced by a hash mark # is the optional last part of a URL for a document. It is typically...
Read more >6 Things You Should Know About Fragment URLs
If you try using fragment URLs in an HTTP sniffer like HttpWatch, you'll never see the fragment IDs in the requested URL or...
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

This works with Firefox 103 Nightly. So it has been fixed at some point:
Hmm, there is a real problem with fragment links though. This works with Chromium but times out with Firefox: