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

Bouncer links fail to activate client if page's canonical URL doesn't match its actual URL #1671

Open
robertknight opened this issue Jan 21, 2025 · 1 comment

Comments

@robertknight
Copy link
Member

robertknight commented Jan 21, 2025

Bouncer links fail to activate the browser extension if the URL that bouncer navigates the browser to ends up redirecting to a different URL with the same content.

One case where this can happen is if a URL A declares a canonical URL B which redirects to URL A. For example https://www.pfrazee.com/blog/why-facets declares a canonical URL of https://pfrazee.com/blog/why-facets. That canonical URL redirects to the www.-prefixed version. When annotating on this page, the canonical URL is used as the annotation's URL. When bouncer detects the extension and asks it to navigate to this URL and activate the client, it will initiate the navigation and then schedule a "pending activation" once the client arrives on the target URL. However since the URL immediately redirects, the user never lands on the expected target URL (ie. the page's canonical URL) and the pending activation is never applied.

@robertknight
Copy link
Member Author

One way we could address this problem would be to avoid testing the tab URL against the specific URL we originally navigated to and instead just wait for the page URL to "settle". A downside of this is that it will break scenarios that currently work where the user gets redirected to a login page, then back to the original URL after they login. In the current implementation, the pending activation will remain pending on the login page and get applied until the user navigates afterwards.

Another approach would be to inject a script into the tab to read the canonical URL if there is a pending activation, and match the URL against both the tab URL and the canonical URL.

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

1 participant