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

enhance(frontend): Self-XSS防止用のメッセージを追加 (misskey-dev#14839)

Cherry-picked from a6a1e3d733e192504986e6e91b5aca9211c331ce

Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
あわわわとーにゅ 2024-11-06 08:27:50 +09:00
parent 0f21232828
commit 1328420f99
No known key found for this signature in database
GPG Key ID: 6AFBBF529601C1DB
3 changed files with 51 additions and 1 deletions

22
locales/index.d.ts vendored
View File

@ -10676,6 +10676,28 @@ export interface Locale extends ILocale {
*/
"nRequests": ParameterizedString<"n">;
};
"_selfXssPrevention": {
/**
*
*/
"warning": string;
/**
*
*/
"title": string;
/**
*
*/
"description1": string;
/**
* %c今すぐ作業を中止してこのウィンドウを閉じてください
*/
"description2": string;
/**
* {link}
*/
"description3": ParameterizedString<"link">;
};
}
declare const locales: {
[lang: string]: Locale;

View File

@ -2833,3 +2833,10 @@ _skebStatus:
yenX: "{x}円"
nWorks: "納品実績 {n}件"
nRequests: "取引実績 {n}件"
_selfXssPrevention:
warning: "警告"
title: "「この画面に何か貼り付けろ」はすべて詐欺です。"
description1: "ここに何かを貼り付けると、悪意のあるユーザーにアカウントを乗っ取られたり、個人情報を盗まれたりする可能性があります。"
description2: "貼り付けようとしているものが何なのかを正確に理解していない場合は、%c今すぐ作業を中止してこのウィンドウを閉じてください。"
description3: "詳しくはこちらをご確認ください。 {link}"

View File

@ -11,7 +11,7 @@ import components from '@/components/index.js';
import { version, lang, updateLocale, locale } from '@/config.js';
import { applyTheme } from '@/scripts/theme.js';
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode.js';
import { updateI18n } from '@/i18n.js';
import { updateI18n, i18n } from '@/i18n.js';
import { $i, refreshAccount, login } from '@/account.js';
import { defaultStore, ColdDeviceStorage } from '@/store.js';
import { fetchInstance, instance } from '@/instance.js';
@ -324,6 +324,27 @@ export async function common(createVue: () => App<Element>) {
removeSplash();
//#region Self-XSS 対策メッセージ
console.log(
`%c${i18n.ts._selfXssPrevention.warning}`,
'color: #f00; background-color: #ff0; font-size: 36px; padding: 4px;',
);
console.log(
`%c${i18n.ts._selfXssPrevention.title}`,
'color: #f00; font-weight: 900; font-family: "Hiragino Sans W9", "Hiragino Kaku Gothic ProN", sans-serif; font-size: 24px;',
);
console.log(
`%c${i18n.ts._selfXssPrevention.description1}`,
'font-size: 16px; font-weight: 700;',
);
console.log(
`%c${i18n.ts._selfXssPrevention.description2}`,
'font-size: 16px;',
'font-size: 20px; font-weight: 700; color: #f00;',
);
console.log(i18n.tsx._selfXssPrevention.description3({ link: 'https://misskey-hub.net/docs/for-users/resources/self-xss/' }));
//#endregion
return {
isClientUpdated,
app,