Merge branch 'feat/malicious-link-checker' into chore/all-my-stuffs

# Conflicts:
#	src/tools/index.ts
This commit is contained in:
ShareVB committed 2024-11-03 21:01:34 +01:00
commit 0da083901f
4 files changed
+79 -1

No files matched your search

+1 -1
View File
@@ -4976,7 +4976,7 @@ packages:
/@vueuse/shared@10.0.0(vue@3.3.4):
resolution: {integrity: sha512-Zh3LgJqvUBWVY3SiMvXanTcfAneGbt63QPczBRDNgQ6jd/ehodO9a1lCFzaA6SWJJoI+ugVTjHFYJdoR656DVQ==}
dependencies:
vue-demi: 0.14.5(vue@3.3.4)
vue-demi: 0.14.10(vue@3.3.4)
transitivePeerDependencies:
- '@vue/composition-api'
- vue
+2
View File
@@ -25,6 +25,7 @@ import { tool as phpArrayToJson } from './php-array-to-json';
import { tool as jsonSizeAnalyzer } from './json-size-analyzer';
import { tool as jsonToCsharp } from './json-to-csharp';
import { tool as luhnValidator } from './luhn-validator';
import { tool as maliciousLinksTester } from './malicious-links-tester';
import { tool as cssXpathConverter } from './css-xpath-converter';
import { tool as cssSelectorsMemo } from './css-selectors-memo';
@@ -220,6 +221,7 @@ export const toolsByCategory: ToolCategory[] = [
jsUnobfuscator,
jsonToPhpArray,
phpArrayToJson,
maliciousLinksTester,
],
},
{
@@ -0,0 +1,12 @@
import { ShieldCheck } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Malicious Links Checker',
path: '/malicious-links-checker',
description: 'Check an url against Google Safe Browsing service',
keywords: ['malicious', 'links', 'checker', 'check', 'safe', 'safe-browsing', 'google'],
component: () => import('./malicious-links-checker.vue'),
icon: ShieldCheck,
createdAt: new Date('2024-05-11'),
});
@@ -0,0 +1,64 @@
<script setup lang="ts">
import { request } from 'malicious-link-detector';
import { useValidation } from '@/composable/validation';
import { useQueryParam } from '@/composable/queryParams';
/*
What tool do you want?
Send Message via Whatsapp Web
Describe the solution you'd like
I would like to have an input field where I can write a mobile number and a textfield, where I can send a message.
A button "Send" which will open the follwowing url:
https://web.whatsapp.com/send/?phone=THE_MOBILE_NUMBER&text=THE_MESSAGE
it is important that the number is formatted correctly:
the "0" at the beginning should be "49" (for germany) and all spaces or characters like "-" should be removed.
*/
const url = useQueryParam({ name: 'url', defaultValue: '' });
const urlValidation = useValidation({
source: url,
rules: [
{
message: 'Invalid url string',
validator: (value) => {
try {
const _ = (new URL(value));
return true;
}
catch {
return false;
}
},
},
],
});
const result = computedAsync(async () => {
const urlValue = url.value;
return await request(urlValue);
});
</script>
<template>
<div>
<c-input-text
v-model:value="url"
label="Website url"
placeholder="Put your website url here..."
clearable
mb-2
:validation="urlValidation"
/>
<c-alert v-if="result !== 'Safe'" type="error">
Danger! '{{ url }}' website is listed as not safe by Google Safe Browsing: <strong>{{ result }}</strong>
<c-alert />
</c-alert>
<c-alert v-if="result" type="success">
This website is safe.
<c-alert />
</c-alert>
</div>
</template>