diff options
| author | Marie <github@yuugi.dev> | 2024-10-04 02:31:22 +0200 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2024-10-04 02:31:22 +0200 |
| commit | d5b372f7a92e3892addb306fc6b62b169e2bfc41 (patch) | |
| tree | b17986d43be7213a56cefa8ccd7db05f472311c7 /packages/frontend/src/plugin.ts | |
| parent | merge: Feat: Implement "Show Below Avatar" for Avatar Decorations (!645) (diff) | |
| download | sharkey-d5b372f7a92e3892addb306fc6b62b169e2bfc41.tar.gz sharkey-d5b372f7a92e3892addb306fc6b62b169e2bfc41.tar.bz2 sharkey-d5b372f7a92e3892addb306fc6b62b169e2bfc41.zip | |
upd&merge: Merge Cherrypick/MisskeyIO's external url popup, delete old popup warning and modify script to handle undefined domains
Diffstat (limited to 'packages/frontend/src/plugin.ts')
| -rw-r--r-- | packages/frontend/src/plugin.ts | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/packages/frontend/src/plugin.ts b/packages/frontend/src/plugin.ts index 9640c988eb..c0034d414c 100644 --- a/packages/frontend/src/plugin.ts +++ b/packages/frontend/src/plugin.ts @@ -9,6 +9,7 @@ import { aiScriptReadline, createAiScriptEnv } from '@/scripts/aiscript/api.js'; import * as os from '@/os.js'; import { i18n } from '@/i18n.js'; import { Plugin, noteActions, notePostInterruptors, noteViewInterruptors, postFormActions, userActions, pageViewInterruptors } from '@/store.js'; +import { warningExternalWebsite } from '@/scripts/warning-external-website.js'; const parser = new Parser(); const pluginContexts = new Map<string, Interpreter>(); @@ -92,16 +93,8 @@ function createPluginEnv(opts: { plugin: Plugin; storageKey: string }): Record<s registerPageViewInterruptor({ pluginId: opts.plugin.id, handler }); }), 'Plugin:open_url': values.FN_NATIVE(([url]) => { - (async () => { - utils.assertString(url); - const { canceled } = await os.confirm({ - type: 'question', - text: i18n.tsx.confirmRemoteUrl({ x: url.value }), - plain: true, - }); - if (canceled) return; - window.open(url.value, '_blank', 'noopener'); - })(); + utils.assertString(url); + warningExternalWebsite(url.value); }), 'Plugin:config': values.OBJ(config), }; |