Skip to content

Commit e94cebf

Browse files
committed
feat(new tool): URL Cleaner
URL Cleaner Remove fbclip, utm params and other tracking parameters
1 parent d3b32cc commit e94cebf

File tree

5 files changed

+77
-6
lines changed

5 files changed

+77
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"plausible-tracker": "^0.3.8",
8282
"qrcode": "^1.5.1",
8383
"sql-formatter": "^13.0.0",
84+
"tidy-url": "^1.15.1",
8485
"ua-parser-js": "^1.0.35",
8586
"ulid": "^2.3.0",
8687
"unicode-emoji-json": "^0.4.0",

pnpm-lock.yaml

Lines changed: 13 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { tool as asciiTextDrawer } from './ascii-text-drawer';
66

77
import { tool as textToUnicode } from './text-to-unicode';
88
import { tool as safelinkDecoder } from './safelink-decoder';
9+
import { tool as urlCleaner } from './url-cleaner';
910
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
1011
import { tool as numeronymGenerator } from './numeronym-generator';
1112
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -115,6 +116,7 @@ export const toolsByCategory: ToolCategory[] = [
115116
urlEncoder,
116117
htmlEntities,
117118
urlParser,
119+
urlCleaner,
118120
deviceInformation,
119121
basicAuthGenerator,
120122
metaTagGenerator,

src/tools/url-cleaner/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { ClearAll } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Url Cleaner',
6+
path: '/url-cleaner',
7+
description: 'Clean Ads tracker, UTM, Facebook and other ads provider parameters from an URL',
8+
keywords: ['url', 'cleaner', 'utm', 'fbclip'],
9+
component: () => import('./url-cleaner.vue'),
10+
icon: ClearAll,
11+
createdAt: new Date('2024-03-13'),
12+
});

src/tools/url-cleaner/url-cleaner.vue

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<script setup lang="ts">
2+
import { TidyURL } from 'tidy-url';
3+
import { Check as CheckIcon, LetterX as CrossIcon } from '@vicons/tabler';
4+
import TextareaCopyable from '@/components/TextareaCopyable.vue';
5+
import { withDefaultOnError } from '@/utils/defaults';
6+
7+
const inputUrl = ref('');
8+
const cleanedUrl = computed(() => withDefaultOnError(() => TidyURL.clean(inputUrl.value), undefined));
9+
const isClean = computed(() => withDefaultOnError(() => TidyURL.clean(inputUrl.value)?.url === inputUrl.value, false));
10+
</script>
11+
12+
<template>
13+
<c-card title="Clean url">
14+
<c-input-text
15+
v-model:value="inputUrl"
16+
placeholder="Put your url here..."
17+
label="Url to clean"
18+
/>
19+
20+
<n-divider />
21+
22+
<div v-if="inputUrl">
23+
<n-p v-if="isClean" text-center>
24+
<n-icon color="green">
25+
<CheckIcon />
26+
</n-icon>
27+
Is clean
28+
</n-p>
29+
<n-p v-if="!isClean" text-center>
30+
<n-icon color="red">
31+
<CrossIcon />
32+
</n-icon>
33+
Was not clean
34+
</n-p>
35+
<TextareaCopyable
36+
label="Cleaned url"
37+
:value="cleanedUrl?.url || ''"
38+
placeholder="The cleaned url will be here"
39+
mb-5
40+
mt-5
41+
/>
42+
<n-p text-center>
43+
<n-a :href="cleanedUrl?.url" target="_blank" rel="noopener noreferrer">
44+
{{ cleanedUrl?.url }}
45+
</n-a>
46+
</n-p>
47+
</div>
48+
</c-card>
49+
</template>

0 commit comments

Comments
 (0)