fix: 标注覆盖可等待落盘;浏览器收藏按当前组+反馈;图库多选勾选标记

This commit is contained in:
qiqi committed 2026-11-26 06:55:56 +08:00
1 parent bde4abc29c
commit c4aa9a60c9
7 files changed
+80 -22

No files matched your search

+20
View File
@@ -105,6 +105,7 @@ function runPlugin({ invokeImpl, prefs, canvas } = {}) {
log() {},
settings: {
get(k) { return settings[k] },
set(k, v) { settings[k] = v; settingsListeners.forEach(function (fn) { try { fn(k) } catch (e) { /* ignore */ } }) },
onChange(fn) {
settingsListeners.push(fn)
return function () { unsubscribed++ }
@@ -135,6 +136,7 @@ function runPlugin({ invokeImpl, prefs, canvas } = {}) {
return {
registered, panel, calls, doc, nodeType,
get unsubscribed() { return unsubscribed },
settings,
fireSetting: (name) => settingsListeners.forEach((fn) => fn(name)),
setSetting: (k, v) => { settings[k] = v }
}
@@ -241,6 +243,24 @@ const okInvoke = () => (name) => {
check('书签点击同样不开独立窗口', openCalls(r).length === 0, JSON.stringify(r.calls))
}
// ---------- 地址栏 ★:必须真的写入 settings(2026-11-26 用户反馈两个入口都收藏不了) ----------
{
const r = runPlugin({ invokeImpl: okInvoke() })
const root = mountPanel(r.panel, r.doc)
const bar = root.children.find((c) => c.className === 'iwb-cwv-bar')
const input = bar.children.find((c) => c.tagName === 'INPUT')
const slot = findClass(root, 'iwb-cwv-bmslot')
const saveBtn = slot.children.find((c) => String(c.className).indexOf('iwb-br-bmsave') >= 0)
input.value = 'example.com'
input.fire('keydown', { key: 'Enter' })
saveBtn.fire('click', { stopPropagation() {} })
await new Promise((resolve) => setTimeout(resolve, 20))
let saved = null
try { saved = JSON.parse(r.settings.bookmarks) } catch (e) { saved = null }
const hit = saved && saved.groups && saved.groups.some((g) => g.items.some((i) => i.url === 'https://example.com/'))
check('★ 收藏当前页真的写进 settings.bookmarks', !!hit, saved ? JSON.stringify(saved).slice(0, 120) : String(r.settings.bookmarks))
}
// ---------- 面板「↗」:把当前页放到画布上(canvasWrite) ----------
{
const created = []