Skip to content

Commit 8ede456

Browse files
committed
Merge branch 'develop'
2 parents fca0502 + 2a3e358 commit 8ede456

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

assets/js/base.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ $('a').each(function() {
88
}
99
});
1010

11+
(function removeUTMParams() {
12+
const url = new URL(window.location.href);
13+
const params = url.searchParams;
14+
const utmParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];
15+
let modified = false;
16+
utmParams.forEach(param => {
17+
if (params.has(param)) {
18+
params.delete(param);
19+
modified = true;
20+
}
21+
});
22+
if (modified) {
23+
const newQuery = params.toString() ? '?' + params.toString() : '';
24+
const newUrl = url.pathname + newQuery + url.hash;
25+
window.history.replaceState({}, document.title, newUrl);
26+
}
27+
})();
28+
1129
function determineGitHubStargazersCount(locale, globalData) {
1230
$.getJSON('https://api.cryptomator.org/desktop/repo.json', data => {
1331
globalData.githubStargazers = formatNumber(data.stargazers_count, locale);

0 commit comments

Comments
 (0)