1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-23 14:46:40 +09:00

fix(MkUrlPreview): 外部サイトへのリンクは移動の前に警告を表示するように

This commit is contained in:
まっちゃとーにゅ 2024-03-22 08:52:46 +09:00
parent 92280818ae
commit f7ec503b9c
No known key found for this signature in database
GPG Key ID: 6AFBBF529601C1DB

View File

@ -44,7 +44,15 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</template>
<div v-else>
<component :is="self ? 'MkA' : 'a'" :class="[$style.link, { [$style.compact]: compact }]" :[attr]="self ? url.substring(local.length) : url" rel="nofollow noopener" :target="target" :title="url">
<component
:is="self ? 'MkA' : 'a'"
:class="[$style.link, { [$style.compact]: compact }]"
:[attr]="self ? url.substring(local.length) : url"
rel="nofollow noopener"
:target="target"
:title="url"
@click="(ev: MouseEvent) => warningExternalWebsite(ev, url)"
>
<div v-if="thumbnail" :class="[$style.thumbnail, { [$style.thumbnailBlur]: sensitive }]" :style="defaultStore.state.dataSaver.urlPreview ? '' : `background-image: url('${thumbnail}')`">
</div>
<article :class="$style.body">
@ -92,6 +100,7 @@ import { deviceKind } from '@/scripts/device-kind.js';
import MkButton from '@/components/MkButton.vue';
import { versatileLang } from '@/scripts/intl-const.js';
import { defaultStore } from '@/store.js';
import { warningExternalWebsite } from '@/scripts/warning-external-website.js';
type SummalyResult = Awaited<ReturnType<typeof summaly>>;