-
-
Notifications
You must be signed in to change notification settings - Fork 408
Google link unwrapping improvements #2902
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
Merged
Merged
+152
−323
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To get the "basic" version of a Google Docs spreadsheet, replace the trailing `/edit` with `/htmlview` in the URL.
942dd01 to
f527224
Compare
Instead of trying to prevent /gen_204 requests by stripping attributes and trying to capture mouse events, let's just block them. The previous approach breaks functionality and fails to consistenly prevent tracking.
331599a to
9958673
Compare
zoracon
reviewed
Jul 26, 2023
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a few comments to collapse some conditions. Otherwise the rest is clear to me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixes #2866, fixes #2900, fixes #2543, fixes #2719.
This fixes cleaning links in image search, Google Docs, Gmail and Google Maps, as well as links added after scrolling the search results page.
Often the link destination is replaced with a redirect URL in response to interaction with the link. Sometimes we catch this mutation in the content script and fix the link in time. Sometimes the page uses a more complicated approach to covertly open a redirect URL at the last moment, which we don't catch in the content script. We work around these cases by redirecting the redirect request to the expected destination in the network layer.
We still want to use a content script to ensure users can copy/paste clean link URLs, and to avoid an unnecessary redirect.
We no longer try to prevent links from triggering
/gen_204requests in the content scripts, but rather block all/gen_204ping/beacon requests in the network layer.Testing notes
✔️: wrapped links that we fix in the content script
😐: more advanced (
window.open()-based) wrapping that we handle via the network redirect fallbacksite ↓
links wrapped on interaction
links wrapped on interaction,
content script unwraps but too late for navigation
links wrapped on interaction,
content script unwraps but too late for navigation
"lite" version
example
comment links: ✔️
comment links: ✔️
/mobilebasicversion with double-wrapped (??) linksexample
/htmlviewversionCountry code TLDs (e.g.
google.co.jp): Same as above, but our content script should still successfully handle country TLD-wrapped links (www.google.co.jp/url?), and our network redirect fallback should handle the country TLD redirect.