Add option to remove tracking parameters from URLs - #1413
Open
E0lee wants to merge 1 commit into
Open
Conversation
Introduces a new setting "Remove tracking parameters from URLs" (default off) in the General preferences pane. When enabled, Maccy strips known tracking query parameters (UTM, Google Ads, Meta, Microsoft, HubSpot, Mailchimp, Marketo, Amazon, and others) from URLs at copy time using URLComponents, so the cleaned URL is what gets stored and pasted. Implementation: - TrackingParameters.plist: bundle resource listing 80+ known tracking params, grouped by vendor for easy future maintenance - URLCleaner.swift: loads the plist at launch and exposes clean(_:) / isURL(_:) - Defaults.Keys+Names.swift: adds removeTrackingParameters Bool key (default false) - Clipboard.swift: applies URLCleaner in the pasteboard capture loop when the setting is enabled and the copied string is an http/https URL - GeneralSettingsPane.swift: adds the toggle in the Behavior section
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
TrackingParameters.plist, making the list easy to extend without recompilingWhat's included
Maccy/TrackingParameters.plistMaccy/URLCleaner.swiftisURL(_:)andclean(_:)usingURLComponentsDefaults.Keys+Names.swiftremoveTrackingParametersBool key (defaultfalse)Clipboard.swifthttp/httpsURL, replaces the stored value with the cleaned URLGeneralSettingsPane.swiften.lproj/GeneralSettings.stringsExample
Copying
https://example.com/page?utm_source=newsletter&utm_campaign=summer&id=42storeshttps://example.com/page?id=42.