没有直接撬 Step 1~9 的核心状态机,而是先把最适合独立的管理器和桥接层拆出来

This commit is contained in:
QLHazyCoder
2026-04-16 23:18:27 +08:00
parent 7828c196af
commit f0c3dcda62
17 changed files with 2686 additions and 1738 deletions
@@ -0,0 +1,17 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
test('background imports panel bridge module', () => {
const source = fs.readFileSync('background.js', 'utf8');
assert.match(source, /importScripts\([\s\S]*'background\/panel-bridge\.js'/);
});
test('panel bridge module exposes a factory', () => {
const source = fs.readFileSync('background/panel-bridge.js', 'utf8');
const globalScope = {};
const api = new Function('self', `${source}; return self.MultiPageBackgroundPanelBridge;`)(globalScope);
assert.equal(typeof api?.createPanelBridge, 'function');
});