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")) {