@silo-code/sdk 0.23.1 → 0.24.0
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/permissions.d.ts +6 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/webview-service.d.ts +164 -0
- package/dist/webview-service.d.ts.map +1 -0
- package/dist/webview-service.js +2 -0
- package/dist/webview-service.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +11 -0
- package/src/permissions.ts +11 -1
- package/src/types.ts +8 -0
- package/src/webview-service.ts +178 -0
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export { DND_MIME } from "./dnd-service.js";
|
|
|
34
34
|
export type { UiService, FileFilter, MenuItem, MenuItemTrailing, MenuSeparator, MenuHeader, MenuEntry, ShowMenuOptions, ConfirmOptions, PromptOptions, ModalOptions, NotifyAction, NotifyOptions, } from "./ui-service.js";
|
|
35
35
|
export { NetworkError } from "./network-service.js";
|
|
36
36
|
export type { NetworkService, NetworkRequestOptions, NetworkResponse, NetworkBytesResponse, } from "./network-service.js";
|
|
37
|
+
export type { WebviewService, WebFrame, WebviewNavType, WebviewNavigateEvent, WebviewRect, PickedElement, } from "./webview-service.js";
|
|
37
38
|
export type { SystemService, SystemInfo } from "./system-service.js";
|
|
38
39
|
export type { LogService, LogLevel } from "./output-service.js";
|
|
39
40
|
export type { ContextKeys } from "./context-keys.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB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AAM,mBAAmB,CAAC;AACvE,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,QAAQ,EACR,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAKjB,YAAY,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,eAA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,CAAC;AAKlE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG7D,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA2GH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA6BhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAoBzC,sEAAsE;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA2GH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA6BhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAoBzC,sEAAsE;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAkCjD,8EAA8E;AAC9E,8EAA8E;AAC9E,6DAA6D;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,yEAAyE;AACzE,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wEAAwE;AACxE,iFAAiF;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/permissions.d.ts
CHANGED
|
@@ -11,11 +11,16 @@
|
|
|
11
11
|
* - `network` — make outbound network requests. Declarative consent only until
|
|
12
12
|
* sandboxed execution lands (in-process code can reach the network directly);
|
|
13
13
|
* declare it so the capability is reviewable and shown at install.
|
|
14
|
+
* - `webview` — use {@link ExtensionContext.webview} to get real DOM access,
|
|
15
|
+
* script execution, and native pixel capture inside an iframe you own,
|
|
16
|
+
* including cross-origin content. Declare it because this reaches into
|
|
17
|
+
* arbitrary embedded pages, not because it touches the filesystem/network
|
|
18
|
+
* directly.
|
|
14
19
|
*
|
|
15
20
|
* @category Extension Contract
|
|
16
21
|
* @public
|
|
17
22
|
*/
|
|
18
|
-
export type Permission = "fs:read" | "fs:write" | "process" | "network";
|
|
23
|
+
export type Permission = "fs:read" | "fs:write" | "process" | "network" | "webview";
|
|
19
24
|
/**
|
|
20
25
|
* Thrown by {@link FileService} and {@link ProcessService} when an extension
|
|
21
26
|
* touches a path — or runs a process with a working directory — outside the open
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAS3C"}
|
package/dist/permissions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,qEAAqE;
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,qEAAqE;AA+BrE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAIxC,YAAY,IAAY,EAAE,OAAgB;QACxC,KAAK,CAAC,OAAO,IAAI,kCAAkC,IAAI,EAAE,CAAC,CAAC;QAJ7D,8DAA8D;QACrD;;;;;WAAa;QAIpB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,4EAA4E;QAC5E,4EAA4E;QAC5E,yCAAyC;QACzC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ import type { ThemeService, ThemePreset } from "./theme-service.js";
|
|
|
38
38
|
import type { DndService } from "./dnd-service.js";
|
|
39
39
|
import type { UiService } from "./ui-service.js";
|
|
40
40
|
import type { NetworkService } from "./network-service.js";
|
|
41
|
+
import type { WebviewService } from "./webview-service.js";
|
|
41
42
|
import type { SystemService } from "./system-service.js";
|
|
42
43
|
import type { LogService } from "./output-service.js";
|
|
43
44
|
import type { ExtensionStorage, ExtensionStorageScopes } from "./extension-storage.js";
|
|
@@ -616,6 +617,13 @@ export interface ExtensionContext {
|
|
|
616
617
|
* loading a URL. See {@link NetworkService} for the full API.
|
|
617
618
|
*/
|
|
618
619
|
readonly net: NetworkService;
|
|
620
|
+
/**
|
|
621
|
+
* Real DOM access, navigation control, and native pixel capture inside an
|
|
622
|
+
* `<iframe>` you own — including cross-origin content the browser's
|
|
623
|
+
* same-origin policy would otherwise fully sandbox. Requires the
|
|
624
|
+
* `"webview"` {@link Permission}. See {@link WebviewService}.
|
|
625
|
+
*/
|
|
626
|
+
readonly webview: WebviewService;
|
|
619
627
|
/**
|
|
620
628
|
* Static host-platform metadata — the OS, CPU architecture, and running Silo
|
|
621
629
|
* version. Values are baked into the binary at build time and never change
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,WA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B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5C,gEAAgE;IAChE,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { Disposable } from "./types.js";
|
|
2
|
+
import type { Event } from "./event.js";
|
|
3
|
+
/**
|
|
4
|
+
* The kind of in-frame navigation reported by {@link WebFrame.onNavigate}.
|
|
5
|
+
*
|
|
6
|
+
* - `"load"` — a full document load (the initial navigation, or any
|
|
7
|
+
* non-SPA link click / `location.href` assignment).
|
|
8
|
+
* - `"push"` / `"replace"` — `history.pushState` / `history.replaceState`,
|
|
9
|
+
* the SPA route-change primitives (React Router, Vue Router, etc.).
|
|
10
|
+
* - `"pop"` — a `popstate` event (back/forward within the SPA).
|
|
11
|
+
* - `"hash"` — a `hashchange` event.
|
|
12
|
+
*
|
|
13
|
+
* @category Core Types
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export type WebviewNavType = "push" | "replace" | "pop" | "load" | "hash";
|
|
17
|
+
/**
|
|
18
|
+
* One navigation event from {@link WebFrame.onNavigate}.
|
|
19
|
+
*
|
|
20
|
+
* @category Core Types
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export interface WebviewNavigateEvent {
|
|
24
|
+
/** The kind of navigation — see {@link WebviewNavType}. */
|
|
25
|
+
type: WebviewNavType;
|
|
26
|
+
/** The frame's URL after the navigation. */
|
|
27
|
+
url: string;
|
|
28
|
+
/**
|
|
29
|
+
* `true` on the first event reported by a freshly created document — i.e.
|
|
30
|
+
* this event is the result of a full document load, whoever initiated it.
|
|
31
|
+
* `false` for every subsequent event from the same document (SPA route
|
|
32
|
+
* changes, the page's own `replaceState` calls, hash changes).
|
|
33
|
+
*
|
|
34
|
+
* This matters because frameworks commonly call `history.replaceState`
|
|
35
|
+
* while booting, so a single full-page navigation can report a `"replace"`
|
|
36
|
+
* event *before* its `"load"`. Without this flag a consumer tracking its
|
|
37
|
+
* own history stack can't tell that boot-time `"replace"` (a brand-new
|
|
38
|
+
* page — usually a new history entry) apart from a genuine in-page
|
|
39
|
+
* `replaceState` (rewrite the current entry).
|
|
40
|
+
*/
|
|
41
|
+
newDocument: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A rectangle in frame-relative CSS pixels — the coordinate space
|
|
45
|
+
* `getBoundingClientRect()` returns inside the frame's own document. Used by
|
|
46
|
+
* {@link WebFrame.captureRect} (e.g. for a picked element or a marquee
|
|
47
|
+
* selection) and returned as part of {@link PickedElement}.
|
|
48
|
+
*
|
|
49
|
+
* @category Core Types
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export interface WebviewRect {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The result of {@link WebFrame.pickElement} — what the user clicked while
|
|
60
|
+
* picking.
|
|
61
|
+
*
|
|
62
|
+
* @category Core Types
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export interface PickedElement {
|
|
66
|
+
/** A CSS selector breadcrumb from `<html>` down to the clicked element (tag + up to 2 classes per level). */
|
|
67
|
+
selector: string;
|
|
68
|
+
/** The element's trimmed text content, truncated to 200 characters. */
|
|
69
|
+
text: string;
|
|
70
|
+
/** The element's frame-relative bounding rect — pass to {@link WebFrame.captureRect} to screenshot just this element. */
|
|
71
|
+
rect: WebviewRect;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A live connection to an embedded frame's content, returned by
|
|
75
|
+
* {@link WebviewService.attach}. Dispose it (or let `ctx.subscriptions`
|
|
76
|
+
* dispose it) when your panel unmounts.
|
|
77
|
+
*
|
|
78
|
+
* @category Consumer Services
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export interface WebFrame extends Disposable {
|
|
82
|
+
/** The frame's current URL, updated on every {@link onNavigate} event. `null` before the first load. */
|
|
83
|
+
readonly url: string | null;
|
|
84
|
+
/** Subscribe to in-frame navigation — the only way to track SPA route changes and full loads alike. See {@link WebviewNavType}. */
|
|
85
|
+
onNavigate: Event<WebviewNavigateEvent>;
|
|
86
|
+
/**
|
|
87
|
+
* Fires when a navigation lands on what looks like a frame-blocked page —
|
|
88
|
+
* sites sending `X-Frame-Options` / `frame-ancestors` don't error, WebKit
|
|
89
|
+
* (and other engines) just commit an empty document at the target URL, so
|
|
90
|
+
* this is a heuristic (empty title + no body content after load), not a
|
|
91
|
+
* definitive diagnosis. Treat it as "this page probably won't work
|
|
92
|
+
* embedded — offer to open it in a browser instead."
|
|
93
|
+
*/
|
|
94
|
+
onBlocked: Event<void>;
|
|
95
|
+
/** Navigate the frame back in its history, if possible. */
|
|
96
|
+
back(): void;
|
|
97
|
+
/** Navigate the frame forward in its history, if possible. */
|
|
98
|
+
forward(): void;
|
|
99
|
+
/** Reload the frame's current page. */
|
|
100
|
+
reload(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Run JavaScript inside the frame and resolve with its result. A single
|
|
103
|
+
* expression's value is returned (e.g. `"document.title"`,
|
|
104
|
+
* `"location.href"`, `"document.querySelectorAll('a').length"`) — matching
|
|
105
|
+
* how a devtools console evaluates. Multi-statement code runs but only
|
|
106
|
+
* returns a value if it ends in an explicit `return`-compatible form.
|
|
107
|
+
* The result must be structured-clone-safe (no DOM nodes, functions, etc.).
|
|
108
|
+
*/
|
|
109
|
+
exec<T = unknown>(code: string): Promise<T>;
|
|
110
|
+
/**
|
|
111
|
+
* Enter interactive element-pick mode: the user hovers to highlight and
|
|
112
|
+
* clicks to select, or presses Escape to cancel. Resolves with the picked
|
|
113
|
+
* element, or `null` if cancelled. No timeout — this is inherently
|
|
114
|
+
* user-paced.
|
|
115
|
+
*/
|
|
116
|
+
pickElement(): Promise<PickedElement | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Cancel an in-flight {@link pickElement} call — exits pick mode in the
|
|
119
|
+
* frame and resolves the pending `pickElement()` promise with `null`. A
|
|
120
|
+
* no-op if no pick is active (including if it already ended, e.g. via
|
|
121
|
+
* Escape or a click).
|
|
122
|
+
*/
|
|
123
|
+
cancelPick(): void;
|
|
124
|
+
/** A native PNG snapshot of the frame's current visible viewport. */
|
|
125
|
+
capture(): Promise<Blob>;
|
|
126
|
+
/** A native PNG snapshot of a frame-relative sub-rect — e.g. a {@link PickedElement.rect} or a marquee selection. */
|
|
127
|
+
captureRect(rect: WebviewRect): Promise<Blob>;
|
|
128
|
+
/** A native PNG snapshot of the frame's entire scrollable document, stitched from scrolled captures. Scroll position is restored afterward. */
|
|
129
|
+
captureFullPage(): Promise<Blob>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The webview-bridge domain, exposed as {@link ExtensionContext.webview}.
|
|
133
|
+
* Requires the `"webview"` {@link Permission}.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* function MyPanel({ ctx }: { ctx: ExtensionContext }) {
|
|
138
|
+
* const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
139
|
+
* const frameRef = useRef<WebFrame | null>(null);
|
|
140
|
+
*
|
|
141
|
+
* useEffect(() => {
|
|
142
|
+
* if (!iframeRef.current) return;
|
|
143
|
+
* const frame = ctx.webview.attach(iframeRef.current);
|
|
144
|
+
* frameRef.current = frame;
|
|
145
|
+
* const sub = frame.onNavigate((e) => console.log(e.type, e.url));
|
|
146
|
+
* return () => { sub.dispose(); frame.dispose(); };
|
|
147
|
+
* }, []);
|
|
148
|
+
*
|
|
149
|
+
* return <iframe ref={iframeRef} src="https://example.com" />;
|
|
150
|
+
* }
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @category Consumer Services
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export interface WebviewService {
|
|
157
|
+
/**
|
|
158
|
+
* Attach the bridge to an iframe your panel owns. The iframe can be
|
|
159
|
+
* cross-origin — that's the point. Returns a {@link WebFrame}; call
|
|
160
|
+
* `.dispose()` (or push it onto `ctx.subscriptions`) when done with it.
|
|
161
|
+
*/
|
|
162
|
+
attach(frame: HTMLIFrameElement): WebFrame;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=webview-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webview-service.d.ts","sourceRoot":"","sources":["../src/webview-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAWrC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,IAAI,EAAE,cAAc,CAAC;IACrB,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;;;;OAYG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,6GAA6G;IAC7G,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,yHAAyH;IACzH,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,wGAAwG;IACxG,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mIAAmI;IACnI,UAAU,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC;;;;;;;OAOG;IACH,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACvB,2DAA2D;IAC3D,IAAI,IAAI,IAAI,CAAC;IACb,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;IAChB,uCAAuC;IACvC,MAAM,IAAI,IAAI,CAAC;IACf;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5C;;;;;OAKG;IACH,WAAW,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,UAAU,IAAI,IAAI,CAAC;IACnB,qEAAqE;IACrE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,qHAAqH;IACrH,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,+IAA+I;IAC/I,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webview-service.js","sourceRoot":"","sources":["../src/webview-service.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -179,6 +179,17 @@ export type {
|
|
|
179
179
|
NetworkBytesResponse,
|
|
180
180
|
} from "./network-service";
|
|
181
181
|
|
|
182
|
+
// The webview-bridge domain: real DOM access, navigation control, and native
|
|
183
|
+
// pixel capture inside an iframe you own, including cross-origin content.
|
|
184
|
+
export type {
|
|
185
|
+
WebviewService,
|
|
186
|
+
WebFrame,
|
|
187
|
+
WebviewNavType,
|
|
188
|
+
WebviewNavigateEvent,
|
|
189
|
+
WebviewRect,
|
|
190
|
+
PickedElement,
|
|
191
|
+
} from "./webview-service";
|
|
192
|
+
|
|
182
193
|
// Static host-platform metadata: OS, CPU arch, and Silo version.
|
|
183
194
|
export type { SystemService, SystemInfo } from "./system-service";
|
|
184
195
|
|
package/src/permissions.ts
CHANGED
|
@@ -16,11 +16,21 @@
|
|
|
16
16
|
* - `network` — make outbound network requests. Declarative consent only until
|
|
17
17
|
* sandboxed execution lands (in-process code can reach the network directly);
|
|
18
18
|
* declare it so the capability is reviewable and shown at install.
|
|
19
|
+
* - `webview` — use {@link ExtensionContext.webview} to get real DOM access,
|
|
20
|
+
* script execution, and native pixel capture inside an iframe you own,
|
|
21
|
+
* including cross-origin content. Declare it because this reaches into
|
|
22
|
+
* arbitrary embedded pages, not because it touches the filesystem/network
|
|
23
|
+
* directly.
|
|
19
24
|
*
|
|
20
25
|
* @category Extension Contract
|
|
21
26
|
* @public
|
|
22
27
|
*/
|
|
23
|
-
export type Permission =
|
|
28
|
+
export type Permission =
|
|
29
|
+
| "fs:read"
|
|
30
|
+
| "fs:write"
|
|
31
|
+
| "process"
|
|
32
|
+
| "network"
|
|
33
|
+
| "webview";
|
|
24
34
|
|
|
25
35
|
/**
|
|
26
36
|
* Thrown by {@link FileService} and {@link ProcessService} when an extension
|
package/src/types.ts
CHANGED
|
@@ -38,6 +38,7 @@ import type { ThemeService, ThemePreset } from "./theme-service";
|
|
|
38
38
|
import type { DndService } from "./dnd-service";
|
|
39
39
|
import type { UiService } from "./ui-service";
|
|
40
40
|
import type { NetworkService } from "./network-service";
|
|
41
|
+
import type { WebviewService } from "./webview-service";
|
|
41
42
|
import type { SystemService } from "./system-service";
|
|
42
43
|
import type { LogService } from "./output-service";
|
|
43
44
|
import type {
|
|
@@ -639,6 +640,13 @@ export interface ExtensionContext {
|
|
|
639
640
|
* loading a URL. See {@link NetworkService} for the full API.
|
|
640
641
|
*/
|
|
641
642
|
readonly net: NetworkService;
|
|
643
|
+
/**
|
|
644
|
+
* Real DOM access, navigation control, and native pixel capture inside an
|
|
645
|
+
* `<iframe>` you own — including cross-origin content the browser's
|
|
646
|
+
* same-origin policy would otherwise fully sandbox. Requires the
|
|
647
|
+
* `"webview"` {@link Permission}. See {@link WebviewService}.
|
|
648
|
+
*/
|
|
649
|
+
readonly webview: WebviewService;
|
|
642
650
|
/**
|
|
643
651
|
* Static host-platform metadata — the OS, CPU architecture, and running Silo
|
|
644
652
|
* version. Values are baked into the binary at build time and never change
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { Disposable } from "./types";
|
|
2
|
+
import type { Event } from "./event";
|
|
3
|
+
|
|
4
|
+
// `ctx.webview` — real DOM access, navigation control, and native pixel
|
|
5
|
+
// capture inside an `<iframe>` your panel owns, including cross-origin
|
|
6
|
+
// content that the browser's same-origin policy would otherwise fully
|
|
7
|
+
// sandbox. The host achieves this by injecting a handshake-gated script into
|
|
8
|
+
// every frame (a Tauri all-frames init script reaches subframes the browser
|
|
9
|
+
// itself can't be reached from) and talking to it over `postMessage`; none of
|
|
10
|
+
// that machinery is visible here — `attach` just gives you a working
|
|
11
|
+
// `WebFrame`. Requires the `"webview"` {@link Permission}.
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The kind of in-frame navigation reported by {@link WebFrame.onNavigate}.
|
|
15
|
+
*
|
|
16
|
+
* - `"load"` — a full document load (the initial navigation, or any
|
|
17
|
+
* non-SPA link click / `location.href` assignment).
|
|
18
|
+
* - `"push"` / `"replace"` — `history.pushState` / `history.replaceState`,
|
|
19
|
+
* the SPA route-change primitives (React Router, Vue Router, etc.).
|
|
20
|
+
* - `"pop"` — a `popstate` event (back/forward within the SPA).
|
|
21
|
+
* - `"hash"` — a `hashchange` event.
|
|
22
|
+
*
|
|
23
|
+
* @category Core Types
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export type WebviewNavType = "push" | "replace" | "pop" | "load" | "hash";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* One navigation event from {@link WebFrame.onNavigate}.
|
|
30
|
+
*
|
|
31
|
+
* @category Core Types
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export interface WebviewNavigateEvent {
|
|
35
|
+
/** The kind of navigation — see {@link WebviewNavType}. */
|
|
36
|
+
type: WebviewNavType;
|
|
37
|
+
/** The frame's URL after the navigation. */
|
|
38
|
+
url: string;
|
|
39
|
+
/**
|
|
40
|
+
* `true` on the first event reported by a freshly created document — i.e.
|
|
41
|
+
* this event is the result of a full document load, whoever initiated it.
|
|
42
|
+
* `false` for every subsequent event from the same document (SPA route
|
|
43
|
+
* changes, the page's own `replaceState` calls, hash changes).
|
|
44
|
+
*
|
|
45
|
+
* This matters because frameworks commonly call `history.replaceState`
|
|
46
|
+
* while booting, so a single full-page navigation can report a `"replace"`
|
|
47
|
+
* event *before* its `"load"`. Without this flag a consumer tracking its
|
|
48
|
+
* own history stack can't tell that boot-time `"replace"` (a brand-new
|
|
49
|
+
* page — usually a new history entry) apart from a genuine in-page
|
|
50
|
+
* `replaceState` (rewrite the current entry).
|
|
51
|
+
*/
|
|
52
|
+
newDocument: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A rectangle in frame-relative CSS pixels — the coordinate space
|
|
57
|
+
* `getBoundingClientRect()` returns inside the frame's own document. Used by
|
|
58
|
+
* {@link WebFrame.captureRect} (e.g. for a picked element or a marquee
|
|
59
|
+
* selection) and returned as part of {@link PickedElement}.
|
|
60
|
+
*
|
|
61
|
+
* @category Core Types
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export interface WebviewRect {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The result of {@link WebFrame.pickElement} — what the user clicked while
|
|
73
|
+
* picking.
|
|
74
|
+
*
|
|
75
|
+
* @category Core Types
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
export interface PickedElement {
|
|
79
|
+
/** A CSS selector breadcrumb from `<html>` down to the clicked element (tag + up to 2 classes per level). */
|
|
80
|
+
selector: string;
|
|
81
|
+
/** The element's trimmed text content, truncated to 200 characters. */
|
|
82
|
+
text: string;
|
|
83
|
+
/** The element's frame-relative bounding rect — pass to {@link WebFrame.captureRect} to screenshot just this element. */
|
|
84
|
+
rect: WebviewRect;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A live connection to an embedded frame's content, returned by
|
|
89
|
+
* {@link WebviewService.attach}. Dispose it (or let `ctx.subscriptions`
|
|
90
|
+
* dispose it) when your panel unmounts.
|
|
91
|
+
*
|
|
92
|
+
* @category Consumer Services
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export interface WebFrame extends Disposable {
|
|
96
|
+
/** The frame's current URL, updated on every {@link onNavigate} event. `null` before the first load. */
|
|
97
|
+
readonly url: string | null;
|
|
98
|
+
/** Subscribe to in-frame navigation — the only way to track SPA route changes and full loads alike. See {@link WebviewNavType}. */
|
|
99
|
+
onNavigate: Event<WebviewNavigateEvent>;
|
|
100
|
+
/**
|
|
101
|
+
* Fires when a navigation lands on what looks like a frame-blocked page —
|
|
102
|
+
* sites sending `X-Frame-Options` / `frame-ancestors` don't error, WebKit
|
|
103
|
+
* (and other engines) just commit an empty document at the target URL, so
|
|
104
|
+
* this is a heuristic (empty title + no body content after load), not a
|
|
105
|
+
* definitive diagnosis. Treat it as "this page probably won't work
|
|
106
|
+
* embedded — offer to open it in a browser instead."
|
|
107
|
+
*/
|
|
108
|
+
onBlocked: Event<void>;
|
|
109
|
+
/** Navigate the frame back in its history, if possible. */
|
|
110
|
+
back(): void;
|
|
111
|
+
/** Navigate the frame forward in its history, if possible. */
|
|
112
|
+
forward(): void;
|
|
113
|
+
/** Reload the frame's current page. */
|
|
114
|
+
reload(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Run JavaScript inside the frame and resolve with its result. A single
|
|
117
|
+
* expression's value is returned (e.g. `"document.title"`,
|
|
118
|
+
* `"location.href"`, `"document.querySelectorAll('a').length"`) — matching
|
|
119
|
+
* how a devtools console evaluates. Multi-statement code runs but only
|
|
120
|
+
* returns a value if it ends in an explicit `return`-compatible form.
|
|
121
|
+
* The result must be structured-clone-safe (no DOM nodes, functions, etc.).
|
|
122
|
+
*/
|
|
123
|
+
exec<T = unknown>(code: string): Promise<T>;
|
|
124
|
+
/**
|
|
125
|
+
* Enter interactive element-pick mode: the user hovers to highlight and
|
|
126
|
+
* clicks to select, or presses Escape to cancel. Resolves with the picked
|
|
127
|
+
* element, or `null` if cancelled. No timeout — this is inherently
|
|
128
|
+
* user-paced.
|
|
129
|
+
*/
|
|
130
|
+
pickElement(): Promise<PickedElement | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Cancel an in-flight {@link pickElement} call — exits pick mode in the
|
|
133
|
+
* frame and resolves the pending `pickElement()` promise with `null`. A
|
|
134
|
+
* no-op if no pick is active (including if it already ended, e.g. via
|
|
135
|
+
* Escape or a click).
|
|
136
|
+
*/
|
|
137
|
+
cancelPick(): void;
|
|
138
|
+
/** A native PNG snapshot of the frame's current visible viewport. */
|
|
139
|
+
capture(): Promise<Blob>;
|
|
140
|
+
/** A native PNG snapshot of a frame-relative sub-rect — e.g. a {@link PickedElement.rect} or a marquee selection. */
|
|
141
|
+
captureRect(rect: WebviewRect): Promise<Blob>;
|
|
142
|
+
/** A native PNG snapshot of the frame's entire scrollable document, stitched from scrolled captures. Scroll position is restored afterward. */
|
|
143
|
+
captureFullPage(): Promise<Blob>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The webview-bridge domain, exposed as {@link ExtensionContext.webview}.
|
|
148
|
+
* Requires the `"webview"` {@link Permission}.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```tsx
|
|
152
|
+
* function MyPanel({ ctx }: { ctx: ExtensionContext }) {
|
|
153
|
+
* const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
154
|
+
* const frameRef = useRef<WebFrame | null>(null);
|
|
155
|
+
*
|
|
156
|
+
* useEffect(() => {
|
|
157
|
+
* if (!iframeRef.current) return;
|
|
158
|
+
* const frame = ctx.webview.attach(iframeRef.current);
|
|
159
|
+
* frameRef.current = frame;
|
|
160
|
+
* const sub = frame.onNavigate((e) => console.log(e.type, e.url));
|
|
161
|
+
* return () => { sub.dispose(); frame.dispose(); };
|
|
162
|
+
* }, []);
|
|
163
|
+
*
|
|
164
|
+
* return <iframe ref={iframeRef} src="https://example.com" />;
|
|
165
|
+
* }
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* @category Consumer Services
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
export interface WebviewService {
|
|
172
|
+
/**
|
|
173
|
+
* Attach the bridge to an iframe your panel owns. The iframe can be
|
|
174
|
+
* cross-origin — that's the point. Returns a {@link WebFrame}; call
|
|
175
|
+
* `.dispose()` (or push it onto `ctx.subscriptions`) when done with it.
|
|
176
|
+
*/
|
|
177
|
+
attach(frame: HTMLIFrameElement): WebFrame;
|
|
178
|
+
}
|