From 78b502bcabf98d3ece73455aefe33b265981b3a4 Mon Sep 17 00:00:00 2001 From: setaria Date: Thu, 27 Jul 2023 09:00:22 +0900 Subject: [PATCH] =?UTF-8?q?URL=E5=8F=96=E5=BE=97=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E3=82=92=E9=96=A2=E6=95=B0=E3=81=AB=E5=A4=89=E6=9B=B4=20#11392?= =?UTF-8?q?=20(#11393)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + packages/frontend/src/scripts/aiscript/api.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 780d867bd..5385b800e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ ### Client - リストTLで、ユーザーが追加・削除されてもTLを初期化しないように +- URL取得変数を関数に変更 CURRENT_URL -> Mk:url() - Fix: モバイル表示のときページ下部がナビゲーションバーに隠れる問題を修正 - Fix: 一部モーダルダイアログでスクロールできない問題を修正 - Fix: Selecting all emojis in Custom emoji is impossible diff --git a/packages/frontend/src/scripts/aiscript/api.ts b/packages/frontend/src/scripts/aiscript/api.ts index 5453fe827..c8b90b4fd 100644 --- a/packages/frontend/src/scripts/aiscript/api.ts +++ b/packages/frontend/src/scripts/aiscript/api.ts @@ -11,7 +11,6 @@ export function createAiScriptEnv(opts) { USER_NAME: $i ? values.STR($i.name) : values.NULL, USER_USERNAME: $i ? values.STR($i.username) : values.NULL, CUSTOM_EMOJIS: utils.jsToVal(customEmojis.value), - CURRENT_URL: values.STR(window.location.href), 'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => { await os.alert({ type: type ? type.value : 'info', @@ -48,5 +47,8 @@ export function createAiScriptEnv(opts) { utils.assertString(key); return utils.jsToVal(JSON.parse(miLocalStorage.getItem(`aiscript:${opts.storageKey}:${key.value}`))); }), + 'Mk:url': values.FN_NATIVE(() => { + return values.STR(window.location.href); + }), }; }