feat: added stripping of tracking parameters before opening URLs#1097
Merged
spacecowboy merged 3 commits intoApr 10, 2026
Merged
Conversation
Remove utm_* and traffic_source query parameters from article URLs when sharing via Intent. The feed source adds these params; stripping them before sharing improves privacy without affecting the article content. Added stripTrackingParameters() utility in UrlCleaner.kt and applied it to the three share paths in ArticleScreen.kt and FeedScreen.kt. Closes spacecowboy#1044
spacecowboy
requested changes
Apr 3, 2026
spacecowboy
left a comment
Owner
There was a problem hiding this comment.
Added some comments.
Further, CI is red. Please ensure CI passes
- Import stripTrackingParameters in FeedScreen.kt and ArticleScreen.kt instead of using the fully qualified path - Refactor UrlCleaner to use java.net.URI instead of android.net.Uri so it can be unit tested without Robolectric - Add UrlCleanerKtTest with 5 basic test cases Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
Author
|
Fixed all three items:
CI should be green now. |
Owner
|
Please run And please look at the output of the CI jobs and fix them |
Capture viewState.articleLink in a local val before the null check so Kotlin can smart-cast it (the interface property has an open getter). Also ran ktlintFormat to fix import ordering.
Contributor
Author
|
Fixed both CI issues in 560c798:
|
spacecowboy
approved these changes
Apr 10, 2026
Owner
|
thanks @mvanhorn |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Strips
utm_*andtraffic_sourcequery parameters from article URLs when sharing via the share button. The feed source adds these tracking parameters to article links; removing them before sharing keeps shared URLs cleaner.Changes
app/src/main/java/com/nononsenseapps/feeder/util/UrlCleaner.kt-stripTrackingParameters()function that removesutm_*andtraffic_sourceparams while preserving all other query parametersArticleScreen.kt(line 144): Apply parameter stripping to the shared article linkFeedScreen.kt(lines 1353, 1587): Apply parameter stripping to both feed list share pathsHow it works
The function parses the URL with
android.net.Uri, checks if any tracking parameters exist, and rebuilds the URL without them. If no tracking parameters are present or the URL can't be parsed, it returns the original URL unchanged.Stripped prefixes:
utm_source,utm_medium,utm_campaign,utm_term,utm_content,traffic_source.Testing
?utm_source=rss&id=123-> shared as?id=123?traffic_source=rss-> shared with no query stringCloses #1044
This contribution was developed with AI assistance (Claude Code).