Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prerender: The url is triming the fragment under prerender #209

Open
spiffytech opened this issue Nov 4, 2024 · 4 comments
Open

prerender: The url is triming the fragment under prerender #209

spiffytech opened this issue Nov 4, 2024 · 4 comments

Comments

@spiffytech
Copy link

spiffytech commented Nov 4, 2024

Bug Report

Current Behavior

When saving a URL that includes a fragment identifier, the meta API url response field strips out any fragment identifier that was in the original URL

In: https://example.com/#hello
Out: https://example.com/

Expected behavior/code

I expect the url field to show what's in the browser address bar after the page loads. If following the link in my browser preserves the fragment, so should Microlink.

Additional context/Screenshots

This is a problem for my use case: I use the url field to get a canonical link to show users, since it resolves HTTPS redirects, shortlinks, etc.

I can't do that if the url field strips out important data (text highlights, or which part of the page is being linked to).

@Kikobeats
Copy link
Member

Thanks for reporting; Working into fix this asap!

@Kikobeats Kikobeats transferred this issue from microlinkhq/open Nov 11, 2024
@Kikobeats
Copy link
Member

After some digging, I discovered that this is actually a Puppeteer feature/bug:
puppeteer/puppeteer#11965 (comment)

Waiting for maintainers thoughts

@Kikobeats Kikobeats changed the title Meta API url field strips fragment identifier from URL prerender: The url is triming the fragment under prerender Nov 11, 2024
@spiffytech
Copy link
Author

I notice Puppeteer displays the URL fragment with page.url(). Are you able to use that?

@Kikobeats
Copy link
Member

unfortunately what we need is response.url() with is the same than request.url() and currently they are not exposing the fragment, but they are working into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants