feat: PDF自绘阅读器+抓手(空格按住/H切换/顶部按钮)+缩放适应宽度(pdf.js worker注入bundle零服务端依赖)

This commit is contained in:
Aisland
2026-08-17 22:50:14 +08:00
parent eaaef0945e
commit b86b2361e8
12 changed files with 666 additions and 46 deletions
+2
View File
@@ -29,6 +29,8 @@ const sandbox = { self: null,
localStorage: { getItem(){ return null }, setItem(){}, removeItem(){} },
atob: (s) => Buffer.from(s, 'base64').toString('binary'), btoa: (s) => Buffer.from(s, 'binary').toString('base64'),
CustomEvent: class { constructor(t, o){ this.type = t; this.detail = o && o.detail } },
DOMMatrix: class {}, Path2D: class {}, ImageData: class {}, TextMetrics: class {}, OffscreenCanvas: class { getContext(){ return null } }, structuredClone: (v) => JSON.parse(JSON.stringify(v)),
DOMException: class extends Error { constructor(m, n){ super(m); this.name = n } }, AbortController: class { constructor(){ this.signal = {} } abort(){} }, queueMicrotask: (f) => Promise.resolve().then(f), ImageBitmap: class {}, MessageChannel: class { constructor(){ this.port1 = {}; this.port2 = {} } }, EventTarget: class { addEventListener(){} removeEventListener(){} dispatchEvent(){ return true } },
ResizeObserver: class { observe(){} disconnect(){} },
MutationObserver: class { observe(){} disconnect(){} },
navigator: { userAgent: "bundle-eval/1.0", platform: "Win32" }, location: { protocol: "http:", host: "127.0.0.1:3080" },