Feature/url tracking params cleaner#235
Open
DavyJones2010 wants to merge 1 commit intoyorkxin:masterfrom
Open
Conversation
c20a188 to
e643b2f
Compare
- Add url-cleaner module to remove tracking params (spm, utm_*, fbclid, gclid, etc.) - Integrate URL cleaning in LinkExportService and TabExportService - Add comprehensive unit tests for URL cleaner (25 tests)
e643b2f to
b4d6039
Compare
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
Remove common tracking parameters from URLs when exporting as Markdown.
Problem
Copied URLs often contain tracking parameters that make Markdown links unnecessarily long:
https://zhuanlan.zhihu.com/p/xxx?utm_source=weibo&utm_medium=zhihuhttps://aliyun.com/product?spm=5176.xxxSolution
Added a URL cleaner module that removes tracking parameters before exporting.
Supported parameters (15+):
spm,scmutm_source,utm_medium,utm_campaign,utm_term,utm_contentfbclid,twclid,ttclidgclid,gclsrc,msclkid_ga,_gl,mc_cid,mc_eidChanges
src/lib/url-cleaner.ts- URL cleaning utilitysrc/services/link-export-service.ts- Integrate URL cleanersrc/services/tab-export-service.ts- Integrate URL cleanertest/url-cleaner.test.ts- 25 test casesTesting
All 120 unit tests pass ✅
Tests
Optional:
AI Disclosure