diff --git a/plugins/index.json b/plugins/index.json index 961fd56..cec0408 100644 --- a/plugins/index.json +++ b/plugins/index.json @@ -13,9 +13,9 @@ }, { "id": "browser", - "file": "plugin-browser.91399c13d011.js", - "version": "1.5.0", - "integrity": "sha256-kTmcE9ARins+w7Go2jzSAOXEau+fC4BnkgerazWWLVE=" + "file": "plugin-browser.9e9fa4cdb25d.js", + "version": "1.6.0", + "integrity": "sha256-np+kzbJdFwMtstq90ATtFv0BoNCtCBKknNY2lXYBEQ8=" }, { "id": "image-annotate", diff --git a/plugins/runtime/plugin-browser.91399c13d011.js b/plugins/runtime/plugin-browser.9e9fa4cdb25d.js similarity index 98% rename from plugins/runtime/plugin-browser.91399c13d011.js rename to plugins/runtime/plugin-browser.9e9fa4cdb25d.js index 362f74f..2c614f4 100644 --- a/plugins/runtime/plugin-browser.91399c13d011.js +++ b/plugins/runtime/plugin-browser.9e9fa4cdb25d.js @@ -640,6 +640,11 @@ st.anchor.setAttribute('data-iwb-cwv', PANEL_ID) st.anchor.setAttribute('data-iwb-cwv-scope', 'panel') webMap[PANEL_ID] = st + // 库面板浏览器默认缩放 = 设置 panelZoom(默认 60%);复用 setZoom 写 data-iwb-cwv-zoom + 同步工具栏百分比。 + // panel 无 node,commit 传 false(不触发 onUpdate 写节点)。 + var pz0 = parseInt(ctx.settings.get('panelZoom'), 10) + if (!isFinite(pz0) || pz0 <= 0) pz0 = 60 + setZoom(st, clampZoom(pz0 / 100), false) st.empty.textContent = '在上方地址栏输入网址,网页会显示在这里' // 面板内浏览同样要靠宿主的原生 webview 引擎(src/canvas-webview.js): // 没有它(网页版 / 旧客户端)就是一块白板,必须说清原因而不是干等。 @@ -718,7 +723,14 @@ } renderBookmarks() host.appendChild(bmWrap) - settingsOff = ctx.settings.onChange(function (name) { if (name === 'bookmarks') renderBookmarks() }) + settingsOff = ctx.settings.onChange(function (name) { + if (name === 'bookmarks') renderBookmarks() + else if (name === 'panelZoom') { + // 改默认缩放即时覆盖当前面板(D2=实时) + var p = parseInt(ctx.settings.get('panelZoom'), 10) + if (isFinite(p) && p > 0) setZoom(st, clampZoom(p / 100), false) + } + }) // 恢复上次访问:面板反复开关(切 tab)都还在同一个页面 var last = normalizeUrl(ctx.settings.get('lastUrl')) @@ -1078,7 +1090,7 @@ global.IWBPluginHost.register({ id: 'browser', name: '应用内浏览器', - version: '1.5.0', + version: '1.6.0', apiVersion: 1, // canvasWrite:面板里的「↗」用它把当前页变成画布上的网页节点(需要客户端 v3.25.30+) capabilities: ['panels', 'nodeTypes', 'canvasWrite'], @@ -1094,6 +1106,12 @@ render: renderBookmarkSettings, // harness 与调试入口(宿主忽略未知字段,不会写进配置) api: bmApi + }, + panelZoom: { + type: 'number', + label: '库面板浏览器默认缩放(%)', + desc: '资源中心「浏览器」面板打开网页时的初始缩放,整数 20–300(面板内 − / + 仍可临时微调,改这里会即时覆盖当前面板)。', + default: 60 } } }, function (ctx) {