From 69ac633417d26e467dd8bd2fc362105fb9792155 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Apr 2026 05:45:45 +0000 Subject: [PATCH 1/2] feat(unskim): strip tracking params from extracted URL, bump to v2.1.0 Agent-Logs-Url: https://github.com/mobilemind/OpenInlets/sessions/8d0b89de-a866-449d-b0af-c9f720f5bb18 Co-authored-by: mobilemind <19366+mobilemind@users.noreply.github.com> --- bookmarklets.json | 2 +- dist/unskim.bookmarklet | 2 +- src/unskim.ts | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bookmarklets.json b/bookmarklets.json index 27354ee..3f0a854 100644 --- a/bookmarklets.json +++ b/bookmarklets.json @@ -98,7 +98,7 @@ { "name": "unskim", "file": "unskim.bookmarklet", - "version": "2.0.2" + "version": "2.1.0" }, { "name": "x-man", diff --git a/dist/unskim.bookmarklet b/dist/unskim.bookmarklet index a8753a5..04beac8 100644 --- a/dist/unskim.bookmarklet +++ b/dist/unskim.bookmarklet @@ -1 +1 @@ -javascript:'use%20strict'%3B(()=%3E%7Blet%20e=new%20URL(document.location.href)%3Bif('safari-resource:%2FErrorPage.html'===e.href)%7Bconst%20t=document.querySelector('p.error-message')%3F.textContent%3F.match(%2FSafari%20can't%20open%20the%20page%20%22(https%3F:%5B%5E%22%5D%2B)%22%2F)%3F.%5B1%5D%3Bt%26%26(e=new%20URL(t))%7Dif(13%3Ee.search.length)return%3Bconst%20t=new%20URLSearchParams(e.search)%2Cr=%5B'url'%2C'destination'%2C'redirect'%2C'target'%2C'goto'%2C'u'%2C'dest'%2C'link'%2C'out'%5D.filter(e=%3Et.has(e)).map(e=%3E%7Bconst%20r=t.get(e)%3Breturn%20r%3FdecodeURIComponent(r):''%7D).find(e=%3Ee.match(%2F%5Ehttps%3F:%2F))%3Br%26%26window.location.replace(new%20URL(r))%7D)()%3Bvoid'2.0.2' \ No newline at end of file +javascript:'use%20strict'%3B(()=%3E%7Blet%20e=new%20URL(document.location.href)%3Bif('safari-resource:%2FErrorPage.html'===e.href)%7Bconst%20t=document.querySelector('p.error-message')%3F.textContent%3F.match(%2FSafari%20can't%20open%20the%20page%20%22(https%3F:%5B%5E%22%5D%2B)%22%2F)%3F.%5B1%5D%3Bt%26%26(e=new%20URL(t))%7Dif(13%3Ee.search.length)return%3Bconst%20t=new%20URLSearchParams(e.search)%2Cr=%5B'url'%2C'destination'%2C'redirect'%2C'target'%2C'goto'%2C'u'%2C'dest'%2C'link'%2C'out'%5D.filter(e=%3Et.has(e)).map(e=%3E%7Bconst%20r=t.get(e)%3Breturn%20r%3FdecodeURIComponent(r):''%7D).find(e=%3Ee.match(%2F%5Ehttps%3F:%2F))%3Bif(r)%7Bconst%20e=new%20URL(r)%3Bif(e.search.length%3E2)%7Bconst%20t=new%20URLSearchParams(e.search)%3Bfor(const%20e%20of%5B...t.keys()%5D)%7Bconst%20r=e.toLowerCase()%3B(r.startsWith('utm%5F')%7C%7Cr.startsWith('fb%5F')%7C%7C%5B'fbclid'%2C'gclid'%2C'msclkid'%2C'ref'%2C'referrer'%2C'ttclid'%2C'twclid'%5D.includes(r))%26%26t.delete(e)%7De.search=t.toString()%7Dwindow.location.replace(e)%7D%7D)()%3Bvoid'2.1.0' \ No newline at end of file diff --git a/src/unskim.ts b/src/unskim.ts index a0425e0..0bfc62c 100644 --- a/src/unskim.ts +++ b/src/unskim.ts @@ -35,9 +35,21 @@ }) .find((url: string) => url.match(/^https?:/)); - // navigate to new URL if found + // navigate to new URL if found, after stripping common tracking params if (urlCandidate) { - window.location.replace(new URL(urlCandidate)); + const targetUrl: URL = new URL(urlCandidate); + if (targetUrl.search.length > 2) { + const targetParams: URLSearchParams = new URLSearchParams(targetUrl.search); + for (const key of [...targetParams.keys()]) { + const k: string = key.toLowerCase(); + if (k.startsWith('utm_') || k.startsWith('fb_') || + ['fbclid', 'gclid', 'msclkid', 'ref', 'referrer', 'ttclid', 'twclid'].includes(k)) { + targetParams.delete(key); + } + } + targetUrl.search = targetParams.toString(); + } + window.location.replace(targetUrl); } })(); From b39de7575147fca232462b672a3c97c854fe3745 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Apr 2026 05:46:49 +0000 Subject: [PATCH 2/2] fix(unskim): use searchParams.size > 0 for cleaner empty-check Agent-Logs-Url: https://github.com/mobilemind/OpenInlets/sessions/8d0b89de-a866-449d-b0af-c9f720f5bb18 Co-authored-by: mobilemind <19366+mobilemind@users.noreply.github.com> --- dist/unskim.bookmarklet | 2 +- src/unskim.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/unskim.bookmarklet b/dist/unskim.bookmarklet index 04beac8..521972e 100644 --- a/dist/unskim.bookmarklet +++ b/dist/unskim.bookmarklet @@ -1 +1 @@ -javascript:'use%20strict'%3B(()=%3E%7Blet%20e=new%20URL(document.location.href)%3Bif('safari-resource:%2FErrorPage.html'===e.href)%7Bconst%20t=document.querySelector('p.error-message')%3F.textContent%3F.match(%2FSafari%20can't%20open%20the%20page%20%22(https%3F:%5B%5E%22%5D%2B)%22%2F)%3F.%5B1%5D%3Bt%26%26(e=new%20URL(t))%7Dif(13%3Ee.search.length)return%3Bconst%20t=new%20URLSearchParams(e.search)%2Cr=%5B'url'%2C'destination'%2C'redirect'%2C'target'%2C'goto'%2C'u'%2C'dest'%2C'link'%2C'out'%5D.filter(e=%3Et.has(e)).map(e=%3E%7Bconst%20r=t.get(e)%3Breturn%20r%3FdecodeURIComponent(r):''%7D).find(e=%3Ee.match(%2F%5Ehttps%3F:%2F))%3Bif(r)%7Bconst%20e=new%20URL(r)%3Bif(e.search.length%3E2)%7Bconst%20t=new%20URLSearchParams(e.search)%3Bfor(const%20e%20of%5B...t.keys()%5D)%7Bconst%20r=e.toLowerCase()%3B(r.startsWith('utm%5F')%7C%7Cr.startsWith('fb%5F')%7C%7C%5B'fbclid'%2C'gclid'%2C'msclkid'%2C'ref'%2C'referrer'%2C'ttclid'%2C'twclid'%5D.includes(r))%26%26t.delete(e)%7De.search=t.toString()%7Dwindow.location.replace(e)%7D%7D)()%3Bvoid'2.1.0' \ No newline at end of file +javascript:'use%20strict'%3B(()=%3E%7Blet%20e=new%20URL(document.location.href)%3Bif('safari-resource:%2FErrorPage.html'===e.href)%7Bconst%20t=document.querySelector('p.error-message')%3F.textContent%3F.match(%2FSafari%20can't%20open%20the%20page%20%22(https%3F:%5B%5E%22%5D%2B)%22%2F)%3F.%5B1%5D%3Bt%26%26(e=new%20URL(t))%7Dif(13%3Ee.search.length)return%3Bconst%20t=new%20URLSearchParams(e.search)%2Cr=%5B'url'%2C'destination'%2C'redirect'%2C'target'%2C'goto'%2C'u'%2C'dest'%2C'link'%2C'out'%5D.filter(e=%3Et.has(e)).map(e=%3E%7Bconst%20r=t.get(e)%3Breturn%20r%3FdecodeURIComponent(r):''%7D).find(e=%3Ee.match(%2F%5Ehttps%3F:%2F))%3Bif(r)%7Bconst%20e=new%20URL(r)%3Bif(e.searchParams.size%3E0)%7Bconst%20t=new%20URLSearchParams(e.search)%3Bfor(const%20e%20of%5B...t.keys()%5D)%7Bconst%20r=e.toLowerCase()%3B(r.startsWith('utm%5F')%7C%7Cr.startsWith('fb%5F')%7C%7C%5B'fbclid'%2C'gclid'%2C'msclkid'%2C'ref'%2C'referrer'%2C'ttclid'%2C'twclid'%5D.includes(r))%26%26t.delete(e)%7De.search=t.toString()%7Dwindow.location.replace(e)%7D%7D)()%3Bvoid'2.1.0' \ No newline at end of file diff --git a/src/unskim.ts b/src/unskim.ts index 0bfc62c..a2640e0 100644 --- a/src/unskim.ts +++ b/src/unskim.ts @@ -38,7 +38,7 @@ // navigate to new URL if found, after stripping common tracking params if (urlCandidate) { const targetUrl: URL = new URL(urlCandidate); - if (targetUrl.search.length > 2) { + if (targetUrl.searchParams.size > 0) { const targetParams: URLSearchParams = new URLSearchParams(targetUrl.search); for (const key of [...targetParams.keys()]) { const k: string = key.toLowerCase();