From 13c741e4602e5bdc869a449382c0cdc5ed376991 Mon Sep 17 00:00:00 2001 From: qiqi Date: Thu, 19 Nov 2026 13:27:20 +0800 Subject: [PATCH] =?UTF-8?q?chore(plugins):=20=E5=90=8C=E6=AD=A5=20browser?= =?UTF-8?q?=201.6.0=EF=BC=88=E5=BA=93=E9=9D=A2=E6=9D=BF=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E5=8F=AF=E9=85=8D=E7=BD=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 从 iwb-plugins-desktop 同步 browser 插件产物(sync-plugins-from-repo.js): - 旧 plugin-browser.91399c13d011.js → 新 plugin-browser.9e9fa4cdb25d.js(内容寻址) - index.json:browser 1.5.0→1.6.0,integrity 更新 - 功能:库面板浏览器默认缩放可配置(panelZoom,默认 60%),宿主零改动 market/ 由 gen-market.js 重新生成(gitignore,发布时 scp 上传 NAS)。 --- plugins/index.json | 6 ++--- ...d011.js => plugin-browser.9e9fa4cdb25d.js} | 22 +++++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) rename plugins/runtime/{plugin-browser.91399c13d011.js => plugin-browser.9e9fa4cdb25d.js} (98%) 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) {