diff options
| author | PrivateGER <privateger@privateger.me> | 2024-10-06 23:13:10 +0200 |
|---|---|---|
| committer | PrivateGER <privateger@privateger.me> | 2024-10-06 23:13:10 +0200 |
| commit | fadae347ffd52a3610ef2e6ce160ade32d3dac31 (patch) | |
| tree | 2731c25215245ba6c9cf4b8738f6868cf33afb78 /packages/frontend/src/plugin.ts | |
| parent | Move text into translation files (diff) | |
| parent | merge: Add option to reject reports from an instance (Resolves #579, #715, #7... (diff) | |
| download | sharkey-fadae347ffd52a3610ef2e6ce160ade32d3dac31.tar.gz sharkey-fadae347ffd52a3610ef2e6ce160ade32d3dac31.tar.bz2 sharkey-fadae347ffd52a3610ef2e6ce160ade32d3dac31.zip | |
Merge branch 'develop' of https://activitypub.software/TransFem-org/Sharkey into feat/instance-admin-ui
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), }; |