vault backup: 2026-11-09 09:18:58
This commit is contained in:
1 parent
856d0203da
commit
75072389db
42 files changed
+5994
-37
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// 桥客户端:通过常驻桥执行表达式,避免每次都新开 Chrome 连接
|
||||
const BRIDGE = 'http://127.0.0.1:65177';
|
||||
|
||||
export async function evalViaBridge(expr, { urlMatch = 'baijiahao.baidu.com', save = null } = {}) {
|
||||
const r = await fetch(BRIDGE + '/eval', {
|
||||
method: 'POST',
|
||||
headers: { 'content-type': 'application/json' },
|
||||
body: JSON.stringify({ expr, urlMatch, save }),
|
||||
});
|
||||
const j = await r.json();
|
||||
if (!j.ok) throw new Error(j.error);
|
||||
return j.value;
|
||||
}
|
||||
|
||||
export async function health() {
|
||||
const r = await fetch(BRIDGE + '/health');
|
||||
return r.json();
|
||||
}
|
||||
Reference in new issue
Block a user