diff options
| author | fEmber <acomputerdog@gmail.com> | 2024-10-03 15:52:00 +0000 |
|---|---|---|
| committer | fEmber <acomputerdog@gmail.com> | 2024-10-03 15:52:00 +0000 |
| commit | e2beec33f87e86282ace98adbb658a3498c9cbeb (patch) | |
| tree | e4f8ad1beb6d5466109e51ec8a1207a51b932e02 /packages/frontend/src/plugin.ts | |
| parent | merge: fix exception when logging IP addresses (!644) (diff) | |
| parent | upd: fix random bg on post button in classic view (diff) | |
| download | sharkey-e2beec33f87e86282ace98adbb658a3498c9cbeb.tar.gz sharkey-e2beec33f87e86282ace98adbb658a3498c9cbeb.tar.bz2 sharkey-e2beec33f87e86282ace98adbb658a3498c9cbeb.zip | |
merge: Minor issue fixes on the frontend (!625)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/625
Closes #659, #656, #651, #661, #632, and #710
Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: fEmber <acomputerdog@gmail.com>
Diffstat (limited to 'packages/frontend/src/plugin.ts')
| -rw-r--r-- | packages/frontend/src/plugin.ts | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/frontend/src/plugin.ts b/packages/frontend/src/plugin.ts index 81233a5a5e..9640c988eb 100644 --- a/packages/frontend/src/plugin.ts +++ b/packages/frontend/src/plugin.ts @@ -6,7 +6,8 @@ import { ref } from 'vue'; import { Interpreter, Parser, utils, values } from '@syuilo/aiscript'; import { aiScriptReadline, createAiScriptEnv } from '@/scripts/aiscript/api.js'; -import { inputText } from '@/os.js'; +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; import { Plugin, noteActions, notePostInterruptors, noteViewInterruptors, postFormActions, userActions, pageViewInterruptors } from '@/store.js'; const parser = new Parser(); @@ -91,8 +92,16 @@ function createPluginEnv(opts: { plugin: Plugin; storageKey: string }): Record<s registerPageViewInterruptor({ pluginId: opts.plugin.id, handler }); }), 'Plugin:open_url': values.FN_NATIVE(([url]) => { - utils.assertString(url); - window.open(url.value, '_blank', 'noopener'); + (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'); + })(); }), 'Plugin:config': values.OBJ(config), }; |