@livx.cc/appwrap 0.43.0 → 0.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/runtime/App_Resources/Android/src/main/AndroidManifest.xml +1 -0
- package/runtime-desktop/bridge-shim/build.sh +9 -0
- package/runtime-desktop/bridge-shim/content-entry.ts +87 -0
- package/runtime-desktop/bridge-shim/shim.ts +132 -0
- package/runtime-desktop/crates/webview-control/Cargo.lock +330 -0
- package/runtime-desktop/crates/webview-control/Cargo.toml +28 -0
- package/runtime-desktop/crates/webview-control/examples/host_harness.rs +245 -0
- package/runtime-desktop/crates/webview-control/src/embedded.rs +100 -0
- package/runtime-desktop/crates/webview-control/src/lib.rs +95 -0
- package/runtime-desktop/crates/webview-control/src/popup.rs +519 -0
- package/runtime-desktop/crates/webview-control/src/profiles.rs +45 -0
- package/runtime-desktop/crates/webview-control/src/wkwebview_backend.rs +497 -0
- package/runtime-desktop/src-tauri/Cargo.lock +15 -0
- package/runtime-desktop/src-tauri/Cargo.toml +5 -0
- package/runtime-desktop/src-tauri/src/bridge_mac.rs +306 -0
- package/runtime-desktop/src-tauri/src/browser_tab.rs +193 -0
- package/runtime-desktop/src-tauri/src/main.rs +206 -3
- package/runtime-desktop/src-tauri/src/popup_mac.rs +5 -466
- package/runtime-desktop/src-tauri/src/server.rs +156 -0
- package/runtime-desktop/src-tauri/tauri.conf.json +1 -0
- package/src/cli.ts +86 -13
- package/src/config.ts +46 -1
- package/src/desktop.ts +48 -1
package/package.json
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
<category android:name="android.intent.category.DEFAULT" />
|
|
54
54
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
55
55
|
<data android:scheme="appwrap" />
|
|
56
|
+
<!-- appwrap:oauth-redirect-schemes --><!-- /appwrap:oauth-redirect-schemes -->
|
|
56
57
|
</intent-filter>
|
|
57
58
|
</activity>
|
|
58
59
|
<activity android:name="com.tns.ErrorReportActivity"/>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Build the injectable content bundle. Must run with the bod-browser repo as cwd so its
|
|
3
|
+
# tsconfig `paths` (shared/*) resolve — the bundle reuses extension/src/content/* unmodified.
|
|
4
|
+
set -e
|
|
5
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
BOD_BROWSER="${BOD_BROWSER:-$HERE/../../../bod-browser}"
|
|
7
|
+
cd "$BOD_BROWSER"
|
|
8
|
+
bun build "$HERE/content-entry.ts" --outfile "$HERE/dist/content.js"
|
|
9
|
+
echo "built $HERE/dist/content.js"
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// SPIKE: browser-bridge content layer for the appwrap desktop (Tauri/WKWebView) shell.
|
|
2
|
+
// Reuses bod-browser's extension/src/content/* modules UNMODIFIED; only the transport differs:
|
|
3
|
+
// instead of chrome.runtime messaging, each page dials a local WS to the shim (bridge-shim/shim.ts)
|
|
4
|
+
// and answers ContentAction messages. Injected per-window via Tauri initialization_script.
|
|
5
|
+
//
|
|
6
|
+
// Build (from the bod-browser repo root so its tsconfig `paths` resolve shared/*):
|
|
7
|
+
// cd ../bod-browser && bun build <this file> --outfile <appwrap>/runtime-desktop/bridge-shim/dist/content.js
|
|
8
|
+
import type { ContentAction } from 'shared/protocol';
|
|
9
|
+
import { advanceScroll } from '../../../bod-browser/extension/src/content/advance-scroll';
|
|
10
|
+
import {
|
|
11
|
+
clickElement, typeInElement, fillElement, doScroll, scrollElementIntoView, evalScript,
|
|
12
|
+
waitForElement, hoverElement, scrollElementBy, hoverNear, sendKey,
|
|
13
|
+
} from '../../../bod-browser/extension/src/content/actions';
|
|
14
|
+
import {
|
|
15
|
+
queryElements, getLinks, findButtons, clickText, queryByText, getElementValue, setElementAttribute,
|
|
16
|
+
} from '../../../bod-browser/extension/src/content/query';
|
|
17
|
+
import { getA11ySnapshot, queryA11y } from '../../../bod-browser/extension/src/content/a11y';
|
|
18
|
+
import { probePage } from '../../../bod-browser/extension/src/content/probe';
|
|
19
|
+
import { diagnosePage } from '../../../bod-browser/extension/src/content/diagnose';
|
|
20
|
+
|
|
21
|
+
declare global {
|
|
22
|
+
interface Window { __BRIDGE_LABEL?: string; __BRIDGE_PORT?: number; __BRIDGE_LOADED?: boolean }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function handleMessage(msg: ContentAction): Promise<unknown> {
|
|
26
|
+
switch (msg.action) {
|
|
27
|
+
case 'getContent':
|
|
28
|
+
return { url: location.href, title: document.title, html: document.documentElement.outerHTML, text: document.body?.innerText ?? '' };
|
|
29
|
+
case 'getTextContent':
|
|
30
|
+
return { url: location.href, title: document.title, text: document.body?.innerText?.slice(0, 20000) || '' };
|
|
31
|
+
case 'query': return queryElements(msg.selector, msg.multiple);
|
|
32
|
+
case 'click': return clickElement(msg.selector);
|
|
33
|
+
case 'type': return typeInElement(msg.selector, msg.value, msg.mode, msg.clear);
|
|
34
|
+
case 'fill': return fillElement(msg.selector, msg.value, msg.timeout, msg.mode, msg.clear);
|
|
35
|
+
case 'getValue': return getElementValue(msg.selector);
|
|
36
|
+
case 'setAttribute': return setElementAttribute(msg.selector, msg.attr, msg.value);
|
|
37
|
+
case 'scroll': return doScroll(msg.x || 0, msg.y || 0, msg.behavior);
|
|
38
|
+
case 'scrollIntoView': return scrollElementIntoView(msg.selector, msg.behavior);
|
|
39
|
+
case 'eval': return evalScript(msg.script);
|
|
40
|
+
case 'waitFor': return waitForElement(msg.selector, msg.timeout || 5000);
|
|
41
|
+
case 'hover': return hoverElement(msg.selector);
|
|
42
|
+
case 'scrollEl': return scrollElementBy(msg.selector, msg.deltaX || 0, msg.deltaY || 0, msg.behavior);
|
|
43
|
+
case 'advanceScroll':
|
|
44
|
+
return advanceScroll({ deltaY: msg.deltaY, itemSelector: msg.itemSelector, loadMoreSelector: msg.loadMoreSelector, behavior: msg.behavior });
|
|
45
|
+
case 'getA11ySnapshot': return getA11ySnapshot(msg.root || null, msg.maxDepth || 10, msg.mode || 'full');
|
|
46
|
+
case 'probe': return probePage(msg.goal || null);
|
|
47
|
+
case 'diagnose': return diagnosePage();
|
|
48
|
+
case 'queryA11y': return queryA11y(msg.role, msg.name, msg.multiple);
|
|
49
|
+
case 'getLinks': return getLinks(msg.pattern || null, msg.scope || null);
|
|
50
|
+
case 'clickText': return clickText(msg.text, msg.scope || null);
|
|
51
|
+
case 'queryByText': return queryByText(msg.text, msg.scope || null);
|
|
52
|
+
case 'findButtons': return findButtons(msg.scope || null);
|
|
53
|
+
case 'sendKey': return sendKey(msg.selector || null, msg.key, msg.modifiers);
|
|
54
|
+
case '_ping': return { pong: true };
|
|
55
|
+
default:
|
|
56
|
+
throw new Error(`Unknown action: ${(msg as ContentAction).action}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
(() => {
|
|
61
|
+
// initialization_script can fire more than once per document lifecycle; guard.
|
|
62
|
+
if (window.__BRIDGE_LOADED) return;
|
|
63
|
+
window.__BRIDGE_LOADED = true;
|
|
64
|
+
const label = window.__BRIDGE_LABEL || 'unknown';
|
|
65
|
+
|
|
66
|
+
// Transport: WebKit blocks ws://127.0.0.1 (and plain-http beacons) from https pages as mixed
|
|
67
|
+
// content — no loopback exemption like Chrome. So results go out via the native
|
|
68
|
+
// WKScriptMessageHandler the shell installs (webkit.messageHandlers.bridgeShim), and commands
|
|
69
|
+
// come in via window.__bridgeDispatch(...) evaluated by the shell (evalJs op).
|
|
70
|
+
type WebkitHandlers = { webkit?: { messageHandlers?: { bridgeShim?: { postMessage: (s: string) => void } } } };
|
|
71
|
+
const post = (o: Record<string, unknown>) => {
|
|
72
|
+
try { (window as WebkitHandlers).webkit?.messageHandlers?.bridgeShim?.postMessage(JSON.stringify({ label, ...o })); } catch { /* ignore */ }
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
(window as unknown as { __bridgeDispatch: (m: ContentAction & { id: string }) => void }).__bridgeDispatch = (m) => {
|
|
76
|
+
Promise.resolve()
|
|
77
|
+
.then(() => handleMessage(m))
|
|
78
|
+
.then(result => post({ id: m.id, result }))
|
|
79
|
+
.catch((e: Error) => post({ id: m.id, error: e.message }));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const register = () => post({ type: 'register', url: location.href, title: document.title });
|
|
83
|
+
register();
|
|
84
|
+
addEventListener('DOMContentLoaded', register);
|
|
85
|
+
addEventListener('load', register);
|
|
86
|
+
console.log(`[BridgeDesktop:cs ${label}] loaded on ${location.href.slice(0, 80)}`);
|
|
87
|
+
})();
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// SPIKE: browser-bridge "extension instance" shim for the appwrap desktop (Tauri) shell.
|
|
3
|
+
// Speaks the UNMODIFIED bod-browser extension protocol to the bridge server (ws://localhost:9230),
|
|
4
|
+
// backed by Tauri windows instead of Chrome tabs:
|
|
5
|
+
// - WS client -> bridge server: hello { instanceId: 'appwrap-desktop' }, answers WsCommand.
|
|
6
|
+
// - WS server :9236 (/page) : each Tauri window's injected content bundle dials in and
|
|
7
|
+
// executes ContentAction messages (the DOM layer).
|
|
8
|
+
// - TCP :9237 (line-JSON) : the Rust shell connects as 'control'; the shim asks it for
|
|
9
|
+
// window ops (createWindow/closeWindow/navigate/screenshot).
|
|
10
|
+
// Run: bun runtime-desktop/bridge-shim/shim.ts
|
|
11
|
+
|
|
12
|
+
const SERVER_URL = process.env.BRIDGE_SERVER_URL || 'ws://localhost:9230';
|
|
13
|
+
const INSTANCE_ID = process.env.BRIDGE_INSTANCE_ID || 'appwrap-desktop';
|
|
14
|
+
const PAGE_PORT = Number(process.env.APPWRAP_BRIDGE_PAGE_PORT || 9236);
|
|
15
|
+
const RUST_PORT = Number(process.env.APPWRAP_BRIDGE_RUST_PORT || 9237);
|
|
16
|
+
|
|
17
|
+
const log = (m: string, ...a: unknown[]) => console.log(`[shim] ${m}`, ...a);
|
|
18
|
+
|
|
19
|
+
// The transport-agnostic browser-automation PRODUCT (tab registry + bod-browser routing +
|
|
20
|
+
// handleCommand) was lifted into the `browser-driver` package inside mcp-desktop-browser (Phase 1b).
|
|
21
|
+
// This file is now a thin TRANSPORT shell: WS client + TCP control channel + page WS, delegating all
|
|
22
|
+
// command handling and page-beacon parsing to the driver below. Consumed as a proper package
|
|
23
|
+
// (`mcp-desktop-browser/browser-driver`, a file: dep in the root package.json → resolves by name,
|
|
24
|
+
// not a fragile cross-repo relative path — the TS analogue of the crate-consumption decision).
|
|
25
|
+
import { createBrowserDriver } from 'mcp-desktop-browser/browser-driver';
|
|
26
|
+
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
// Rust control channel (TCP, newline-delimited JSON)
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
type Pending = { resolve: (v: unknown) => void; reject: (e: Error) => void; timer: ReturnType<typeof setTimeout> };
|
|
31
|
+
let rustSock: { write: (s: string) => void } | null = null;
|
|
32
|
+
const rustPending = new Map<string, Pending>();
|
|
33
|
+
let reqCounter = 0;
|
|
34
|
+
|
|
35
|
+
function rustRequest(op: string, params: Record<string, unknown> = {}, timeoutMs = 15000): Promise<unknown> {
|
|
36
|
+
if (!rustSock) return Promise.reject(new Error('Desktop shell not connected to shim (is the app running with APPWRAP_BRIDGE_JS?)'));
|
|
37
|
+
const id = `r${++reqCounter}`;
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
const timer = setTimeout(() => { rustPending.delete(id); reject(new Error(`rust op ${op} timed out`)); }, timeoutMs);
|
|
40
|
+
rustPending.set(id, { resolve, reject, timer });
|
|
41
|
+
rustSock!.write(JSON.stringify({ id, op, ...params }) + '\n');
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// The product layer — driven through our transport (rustRequest) + fed page beacons via onPageMsg.
|
|
46
|
+
const driver = createBrowserDriver({ rustRequest, log });
|
|
47
|
+
|
|
48
|
+
Bun.listen({
|
|
49
|
+
hostname: '127.0.0.1',
|
|
50
|
+
port: RUST_PORT,
|
|
51
|
+
socket: {
|
|
52
|
+
open(socket) {
|
|
53
|
+
log('rust control connected');
|
|
54
|
+
rustSock = { write: (s) => socket.write(s) };
|
|
55
|
+
(socket as unknown as { __buf: string }).__buf = '';
|
|
56
|
+
},
|
|
57
|
+
data(socket, data) {
|
|
58
|
+
const s = socket as unknown as { __buf: string };
|
|
59
|
+
s.__buf += data.toString();
|
|
60
|
+
let idx: number;
|
|
61
|
+
while ((idx = s.__buf.indexOf('\n')) >= 0) {
|
|
62
|
+
const line = s.__buf.slice(0, idx).trim();
|
|
63
|
+
s.__buf = s.__buf.slice(idx + 1);
|
|
64
|
+
if (!line) continue;
|
|
65
|
+
try {
|
|
66
|
+
const msg = JSON.parse(line);
|
|
67
|
+
if (msg.type === 'pageMsg') { driver.onPageMsg(String(msg.payload)); continue; }
|
|
68
|
+
const p = rustPending.get(msg.id);
|
|
69
|
+
if (p) {
|
|
70
|
+
rustPending.delete(msg.id);
|
|
71
|
+
clearTimeout(p.timer);
|
|
72
|
+
if (msg.error) p.reject(new Error(String(msg.error)));
|
|
73
|
+
else p.resolve(msg.result);
|
|
74
|
+
}
|
|
75
|
+
} catch (e) { log('bad rust line:', line.slice(0, 200), (e as Error).message); }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
close() { log('rust control disconnected'); rustSock = null; },
|
|
79
|
+
error(_s, e) { log('rust control error:', e.message); },
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// Debug HTTP endpoint (curl a raw rust op / read page beacons)
|
|
84
|
+
Bun.serve({
|
|
85
|
+
hostname: '127.0.0.1',
|
|
86
|
+
port: PAGE_PORT,
|
|
87
|
+
async fetch(req) {
|
|
88
|
+
const path = new URL(req.url).pathname;
|
|
89
|
+
if (path === '/log' && req.method === 'POST') { log('page:', await req.text()); return new Response('ok'); }
|
|
90
|
+
if (path === '/rust' && req.method === 'POST') {
|
|
91
|
+
const body = await req.json() as Record<string, unknown>;
|
|
92
|
+
try { return Response.json({ result: await rustRequest(String(body.op), body) }); }
|
|
93
|
+
catch (e) { return Response.json({ error: (e as Error).message }); }
|
|
94
|
+
}
|
|
95
|
+
return new Response('bridge-shim debug endpoint', { status: 200 });
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// Bridge server WS client (the extension background's ws.ts analogue)
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
let serverWs: WebSocket | null = null;
|
|
103
|
+
function connectServer() {
|
|
104
|
+
serverWs = new WebSocket(SERVER_URL);
|
|
105
|
+
serverWs.onopen = () => {
|
|
106
|
+
log(`connected to bridge server ${SERVER_URL} as ${INSTANCE_ID}`);
|
|
107
|
+
serverWs!.send(JSON.stringify({ type: 'hello', userAgent: `appwrap-desktop-shell (Tauri/WKWebView; ${process.platform})`, instanceId: INSTANCE_ID, buildHash: 'appwrap-desktop-spike' }));
|
|
108
|
+
serverWs!.send(JSON.stringify({ type: 'ping', t: Date.now() }));
|
|
109
|
+
};
|
|
110
|
+
serverWs.onmessage = async (ev) => {
|
|
111
|
+
let msg: { id: string; cmd: string; params?: Record<string, unknown>; type?: string } | undefined;
|
|
112
|
+
try {
|
|
113
|
+
const parsed = JSON.parse(String(ev.data));
|
|
114
|
+
if (parsed.type === 'pong' || parsed.type === 'reload' || parsed.type === 'recording_saved') return;
|
|
115
|
+
msg = parsed;
|
|
116
|
+
const result = await driver.handleCommand(msg!);
|
|
117
|
+
log(`cmd=${msg!.cmd} ok`);
|
|
118
|
+
serverWs!.send(JSON.stringify({ id: msg!.id, result }));
|
|
119
|
+
} catch (e) {
|
|
120
|
+
log(`cmd=${msg?.cmd} error: ${(e as Error).message}`);
|
|
121
|
+
try { serverWs!.send(JSON.stringify({ id: msg?.id, error: (e as Error).message })); } catch { /* ignore */ }
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
serverWs.onclose = () => { log('server disconnected, retrying in 3s'); setTimeout(connectServer, 3000); };
|
|
125
|
+
serverWs.onerror = () => { /* onclose follows */ };
|
|
126
|
+
}
|
|
127
|
+
connectServer();
|
|
128
|
+
setInterval(() => {
|
|
129
|
+
if (serverWs?.readyState === WebSocket.OPEN) serverWs.send(JSON.stringify({ type: 'ping', t: Date.now() }));
|
|
130
|
+
}, 15000);
|
|
131
|
+
|
|
132
|
+
log(`page WS :${PAGE_PORT} rust control :${RUST_PORT}`);
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "bitflags"
|
|
7
|
+
version = "2.13.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "block2"
|
|
13
|
+
version = "0.6.2"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
|
|
16
|
+
dependencies = [
|
|
17
|
+
"objc2",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[[package]]
|
|
21
|
+
name = "dispatch2"
|
|
22
|
+
version = "0.3.1"
|
|
23
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
+
checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
|
|
25
|
+
dependencies = [
|
|
26
|
+
"bitflags",
|
|
27
|
+
"objc2",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[[package]]
|
|
31
|
+
name = "itoa"
|
|
32
|
+
version = "1.0.18"
|
|
33
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
34
|
+
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
|
35
|
+
|
|
36
|
+
[[package]]
|
|
37
|
+
name = "libc"
|
|
38
|
+
version = "0.2.186"
|
|
39
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
40
|
+
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
|
41
|
+
|
|
42
|
+
[[package]]
|
|
43
|
+
name = "memchr"
|
|
44
|
+
version = "2.8.3"
|
|
45
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
46
|
+
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
47
|
+
|
|
48
|
+
[[package]]
|
|
49
|
+
name = "objc2"
|
|
50
|
+
version = "0.6.4"
|
|
51
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
52
|
+
checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f"
|
|
53
|
+
dependencies = [
|
|
54
|
+
"objc2-encode",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[[package]]
|
|
58
|
+
name = "objc2-app-kit"
|
|
59
|
+
version = "0.3.2"
|
|
60
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
61
|
+
checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
|
|
62
|
+
dependencies = [
|
|
63
|
+
"bitflags",
|
|
64
|
+
"block2",
|
|
65
|
+
"libc",
|
|
66
|
+
"objc2",
|
|
67
|
+
"objc2-cloud-kit",
|
|
68
|
+
"objc2-core-data",
|
|
69
|
+
"objc2-core-foundation",
|
|
70
|
+
"objc2-core-graphics",
|
|
71
|
+
"objc2-core-image",
|
|
72
|
+
"objc2-core-text",
|
|
73
|
+
"objc2-core-video",
|
|
74
|
+
"objc2-foundation",
|
|
75
|
+
"objc2-quartz-core",
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
[[package]]
|
|
79
|
+
name = "objc2-cloud-kit"
|
|
80
|
+
version = "0.3.2"
|
|
81
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
82
|
+
checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c"
|
|
83
|
+
dependencies = [
|
|
84
|
+
"bitflags",
|
|
85
|
+
"objc2",
|
|
86
|
+
"objc2-foundation",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[[package]]
|
|
90
|
+
name = "objc2-core-data"
|
|
91
|
+
version = "0.3.2"
|
|
92
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
+
checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa"
|
|
94
|
+
dependencies = [
|
|
95
|
+
"bitflags",
|
|
96
|
+
"objc2",
|
|
97
|
+
"objc2-foundation",
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
[[package]]
|
|
101
|
+
name = "objc2-core-foundation"
|
|
102
|
+
version = "0.3.2"
|
|
103
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
104
|
+
checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
|
|
105
|
+
dependencies = [
|
|
106
|
+
"bitflags",
|
|
107
|
+
"dispatch2",
|
|
108
|
+
"objc2",
|
|
109
|
+
]
|
|
110
|
+
|
|
111
|
+
[[package]]
|
|
112
|
+
name = "objc2-core-graphics"
|
|
113
|
+
version = "0.3.2"
|
|
114
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
115
|
+
checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"
|
|
116
|
+
dependencies = [
|
|
117
|
+
"bitflags",
|
|
118
|
+
"dispatch2",
|
|
119
|
+
"objc2",
|
|
120
|
+
"objc2-core-foundation",
|
|
121
|
+
"objc2-io-surface",
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
[[package]]
|
|
125
|
+
name = "objc2-core-image"
|
|
126
|
+
version = "0.3.2"
|
|
127
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
128
|
+
checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006"
|
|
129
|
+
dependencies = [
|
|
130
|
+
"objc2",
|
|
131
|
+
"objc2-foundation",
|
|
132
|
+
]
|
|
133
|
+
|
|
134
|
+
[[package]]
|
|
135
|
+
name = "objc2-core-text"
|
|
136
|
+
version = "0.3.2"
|
|
137
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
138
|
+
checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d"
|
|
139
|
+
dependencies = [
|
|
140
|
+
"bitflags",
|
|
141
|
+
"objc2",
|
|
142
|
+
"objc2-core-foundation",
|
|
143
|
+
"objc2-core-graphics",
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
[[package]]
|
|
147
|
+
name = "objc2-core-video"
|
|
148
|
+
version = "0.3.2"
|
|
149
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
150
|
+
checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6"
|
|
151
|
+
dependencies = [
|
|
152
|
+
"bitflags",
|
|
153
|
+
"objc2",
|
|
154
|
+
"objc2-core-foundation",
|
|
155
|
+
"objc2-core-graphics",
|
|
156
|
+
"objc2-io-surface",
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
[[package]]
|
|
160
|
+
name = "objc2-encode"
|
|
161
|
+
version = "4.1.0"
|
|
162
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
163
|
+
checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
|
|
164
|
+
|
|
165
|
+
[[package]]
|
|
166
|
+
name = "objc2-foundation"
|
|
167
|
+
version = "0.3.2"
|
|
168
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
169
|
+
checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
|
|
170
|
+
dependencies = [
|
|
171
|
+
"bitflags",
|
|
172
|
+
"block2",
|
|
173
|
+
"libc",
|
|
174
|
+
"objc2",
|
|
175
|
+
"objc2-core-foundation",
|
|
176
|
+
]
|
|
177
|
+
|
|
178
|
+
[[package]]
|
|
179
|
+
name = "objc2-io-surface"
|
|
180
|
+
version = "0.3.2"
|
|
181
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
182
|
+
checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
|
|
183
|
+
dependencies = [
|
|
184
|
+
"bitflags",
|
|
185
|
+
"objc2",
|
|
186
|
+
"objc2-core-foundation",
|
|
187
|
+
]
|
|
188
|
+
|
|
189
|
+
[[package]]
|
|
190
|
+
name = "objc2-javascript-core"
|
|
191
|
+
version = "0.3.2"
|
|
192
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
193
|
+
checksum = "2a1e6550c4caed348956ce3370c9ffeca70bb1dbed4fa96112e7c6170e074586"
|
|
194
|
+
dependencies = [
|
|
195
|
+
"objc2",
|
|
196
|
+
"objc2-core-foundation",
|
|
197
|
+
]
|
|
198
|
+
|
|
199
|
+
[[package]]
|
|
200
|
+
name = "objc2-quartz-core"
|
|
201
|
+
version = "0.3.2"
|
|
202
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
203
|
+
checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"
|
|
204
|
+
dependencies = [
|
|
205
|
+
"bitflags",
|
|
206
|
+
"objc2",
|
|
207
|
+
"objc2-foundation",
|
|
208
|
+
]
|
|
209
|
+
|
|
210
|
+
[[package]]
|
|
211
|
+
name = "objc2-security"
|
|
212
|
+
version = "0.3.2"
|
|
213
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
214
|
+
checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a"
|
|
215
|
+
dependencies = [
|
|
216
|
+
"bitflags",
|
|
217
|
+
"objc2",
|
|
218
|
+
"objc2-core-foundation",
|
|
219
|
+
]
|
|
220
|
+
|
|
221
|
+
[[package]]
|
|
222
|
+
name = "objc2-web-kit"
|
|
223
|
+
version = "0.3.2"
|
|
224
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
225
|
+
checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f"
|
|
226
|
+
dependencies = [
|
|
227
|
+
"bitflags",
|
|
228
|
+
"block2",
|
|
229
|
+
"objc2",
|
|
230
|
+
"objc2-app-kit",
|
|
231
|
+
"objc2-core-foundation",
|
|
232
|
+
"objc2-foundation",
|
|
233
|
+
"objc2-javascript-core",
|
|
234
|
+
"objc2-security",
|
|
235
|
+
]
|
|
236
|
+
|
|
237
|
+
[[package]]
|
|
238
|
+
name = "proc-macro2"
|
|
239
|
+
version = "1.0.106"
|
|
240
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
241
|
+
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
|
|
242
|
+
dependencies = [
|
|
243
|
+
"unicode-ident",
|
|
244
|
+
]
|
|
245
|
+
|
|
246
|
+
[[package]]
|
|
247
|
+
name = "quote"
|
|
248
|
+
version = "1.0.46"
|
|
249
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
250
|
+
checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
|
|
251
|
+
dependencies = [
|
|
252
|
+
"proc-macro2",
|
|
253
|
+
]
|
|
254
|
+
|
|
255
|
+
[[package]]
|
|
256
|
+
name = "serde"
|
|
257
|
+
version = "1.0.228"
|
|
258
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
259
|
+
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
|
|
260
|
+
dependencies = [
|
|
261
|
+
"serde_core",
|
|
262
|
+
]
|
|
263
|
+
|
|
264
|
+
[[package]]
|
|
265
|
+
name = "serde_core"
|
|
266
|
+
version = "1.0.228"
|
|
267
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
268
|
+
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
|
|
269
|
+
dependencies = [
|
|
270
|
+
"serde_derive",
|
|
271
|
+
]
|
|
272
|
+
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "serde_derive"
|
|
275
|
+
version = "1.0.228"
|
|
276
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
277
|
+
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
|
|
278
|
+
dependencies = [
|
|
279
|
+
"proc-macro2",
|
|
280
|
+
"quote",
|
|
281
|
+
"syn",
|
|
282
|
+
]
|
|
283
|
+
|
|
284
|
+
[[package]]
|
|
285
|
+
name = "serde_json"
|
|
286
|
+
version = "1.0.150"
|
|
287
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
288
|
+
checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
|
|
289
|
+
dependencies = [
|
|
290
|
+
"itoa",
|
|
291
|
+
"memchr",
|
|
292
|
+
"serde",
|
|
293
|
+
"serde_core",
|
|
294
|
+
"zmij",
|
|
295
|
+
]
|
|
296
|
+
|
|
297
|
+
[[package]]
|
|
298
|
+
name = "syn"
|
|
299
|
+
version = "2.0.118"
|
|
300
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
301
|
+
checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
|
|
302
|
+
dependencies = [
|
|
303
|
+
"proc-macro2",
|
|
304
|
+
"quote",
|
|
305
|
+
"unicode-ident",
|
|
306
|
+
]
|
|
307
|
+
|
|
308
|
+
[[package]]
|
|
309
|
+
name = "unicode-ident"
|
|
310
|
+
version = "1.0.24"
|
|
311
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
312
|
+
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
313
|
+
|
|
314
|
+
[[package]]
|
|
315
|
+
name = "webview-control"
|
|
316
|
+
version = "0.1.0"
|
|
317
|
+
dependencies = [
|
|
318
|
+
"block2",
|
|
319
|
+
"objc2",
|
|
320
|
+
"objc2-app-kit",
|
|
321
|
+
"objc2-foundation",
|
|
322
|
+
"objc2-web-kit",
|
|
323
|
+
"serde_json",
|
|
324
|
+
]
|
|
325
|
+
|
|
326
|
+
[[package]]
|
|
327
|
+
name = "zmij"
|
|
328
|
+
version = "1.0.21"
|
|
329
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
330
|
+
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# webview-control — appwrap's generalized, automation-agnostic native webview primitive.
|
|
2
|
+
# Carved out of src-tauri/src/bridge_mac.rs (Phase 1). Owns per-profile persistent+isolated
|
|
3
|
+
# WKWebsiteDataStore windows, CSP-immune eval, snapshot, the bridgeShim WKScriptMessageHandler,
|
|
4
|
+
# and the SSO-popup delegate (popup module). It emits RAW script-message payloads + RAW eval
|
|
5
|
+
# results via callbacks — it holds NO bod-browser protocol / transport knowledge (that stays in
|
|
6
|
+
# the control-channel adapter, bridge_mac.rs).
|
|
7
|
+
#
|
|
8
|
+
# objc2* versions MUST match src-tauri/Cargo.toml exactly — the same WKWebView pointer crosses the
|
|
9
|
+
# crate boundary (pw.inner() as *mut WKWebView), so a version mismatch would make that cast UB.
|
|
10
|
+
[package]
|
|
11
|
+
name = "webview-control"
|
|
12
|
+
version = "0.1.0"
|
|
13
|
+
edition = "2021"
|
|
14
|
+
|
|
15
|
+
[lib]
|
|
16
|
+
# macOS-only today; a WebKitGtkBackend is a future slot behind the same seam (see ARCHITECTURE.md).
|
|
17
|
+
name = "webview_control"
|
|
18
|
+
path = "src/lib.rs"
|
|
19
|
+
|
|
20
|
+
[dependencies]
|
|
21
|
+
|
|
22
|
+
[target.'cfg(target_os = "macos")'.dependencies]
|
|
23
|
+
serde_json = "1"
|
|
24
|
+
objc2 = "0.6"
|
|
25
|
+
objc2-foundation = "0.3"
|
|
26
|
+
objc2-app-kit = "0.3"
|
|
27
|
+
objc2-web-kit = "0.3"
|
|
28
|
+
block2 = "0.6"
|