Skip to content

Feature/url tracking params cleaner#235

Open
DavyJones2010 wants to merge 1 commit intoyorkxin:masterfrom
DavyJones2010:feature/url-tracking-params-cleaner
Open

Feature/url tracking params cleaner#235
DavyJones2010 wants to merge 1 commit intoyorkxin:masterfrom
DavyJones2010:feature/url-tracking-params-cleaner

Conversation

@DavyJones2010
Copy link

@DavyJones2010 DavyJones2010 commented Mar 4, 2026

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=zhihu
  • https://aliyun.com/product?spm=5176.xxx

Solution

Added a URL cleaner module that removes tracking parameters before exporting.

Supported parameters (15+):

  • Alibaba: spm, scm
  • Google Analytics: utm_source, utm_medium, utm_campaign, utm_term, utm_content
  • Social: fbclid, twclid, ttclid
  • Ads: gclid, gclsrc, msclkid
  • Others: _ga, _gl, mc_cid, mc_eid

Changes

  • New: src/lib/url-cleaner.ts - URL cleaning utility
  • Modified: src/services/link-export-service.ts - Integrate URL cleaner
  • Modified: src/services/tab-export-service.ts - Integrate URL cleaner
  • New: test/url-cleaner.test.ts - 25 test cases

Testing

All 120 unit tests pass ✅

Tests

  • Chrome stable (macOS)
  • Firefox stable (macOS)
  • Chrome stable (Windows)
  • Firefox stable (Windows)

Optional:

  • Chrome beta (macOS)
  • Firefox beta (macOS)
  • Chrome beta (Windows)
  • Firefox beta (Windows)

AI Disclosure

  • I used coding agents to create this patch. I understand and am responsible for all the code it generates.
  • I did not use any coding agent to create this patch. I am responsible for all the code I wrote.

@DavyJones2010 DavyJones2010 force-pushed the feature/url-tracking-params-cleaner branch from c20a188 to e643b2f Compare March 4, 2026 08:27
- 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)
@DavyJones2010 DavyJones2010 force-pushed the feature/url-tracking-params-cleaner branch from e643b2f to b4d6039 Compare March 4, 2026 09:41
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

Successfully merging this pull request may close these issues.

1 participant