From 96bc21093aa00caf5f9c95df9ccca5d4522461d5 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 12 Feb 2026 23:39:59 +0800 Subject: [PATCH] :iphone: https://github.com/siyuan-note/siyuan/issues/17006 --- app/src/assets/template/mobile/index.tpl | 2 +- app/src/mobile/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/assets/template/mobile/index.tpl b/app/src/assets/template/mobile/index.tpl index 01251797a..2f4cc85cb 100644 --- a/app/src/assets/template/mobile/index.tpl +++ b/app/src/assets/template/mobile/index.tpl @@ -2,7 +2,7 @@ - + diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts index 36984306f..ab737127c 100644 --- a/app/src/mobile/index.ts +++ b/app/src/mobile/index.ts @@ -15,7 +15,7 @@ import {bootSync} from "../dialog/processSystem"; import {initMessage, showMessage} from "../dialog/message"; import {goBack} from "./util/MobileBackFoward"; import {activeBlur, hideKeyboardToolbar, showKeyboardToolbar} from "./util/keyboardToolbar"; -import {getLocalStorage, writeText} from "../protyle/util/compatibility"; +import {getLocalStorage, isChromeBrowser, writeText} from "../protyle/util/compatibility"; import {getCurrentEditor, openMobileFileById} from "./editor"; import {getSearch} from "../util/functions"; import {checkPublishServiceClosed} from "../util/processMessage"; @@ -76,6 +76,9 @@ class App { } }) }; + if (isChromeBrowser()) { + document.querySelector('meta[name="viewport"]').setAttribute("content", "width=device-width, height=device-height, interactive-widget=resizes-content, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover"); + } // 不能使用 touchstart,否则会被 event.stopImmediatePropagation() 阻塞 window.addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => { if (!window.siyuan.menus.menu.element.contains(event.target) && !hasClosestByAttribute(event.target, "data-menu", "true")) {