@gjsify/iframe 0.45.0 → 0.46.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/README.md +39 -0
- package/lib/esm/iframe-bridge.js +1 -1
- package/lib/esm/iframe-message-channel.js +1 -1
- package/lib/types/iframe-bridge.d.ts +43 -1
- package/lib/types/iframe-message-channel.d.ts +2 -2
- package/lib/types/iframe-window-proxy.d.ts +1 -1
- package/lib/types/message-bridge.d.ts +1 -1
- package/package.json +16 -14
package/README.md
CHANGED
|
@@ -66,6 +66,45 @@ widget.installGlobals(); // globalThis.HTMLIFrameElement + the 'iframe' elemen
|
|
|
66
66
|
> import side effect. See
|
|
67
67
|
> [ADR 0012](https://github.com/gjsify/gjsify/blob/main/docs/adr/0012-framework-register-ownership.md).
|
|
68
68
|
|
|
69
|
+
## Runtimes — GJS and Node
|
|
70
|
+
|
|
71
|
+
The package binds GJS through nothing but `gi://` (`WebKit`, `JavaScriptCore`,
|
|
72
|
+
`GLib`, `GObject`, `Gio`), and `--app node` rewrites every one of those to
|
|
73
|
+
`@gjsify/node-gi`'s `requireGi(…)`. So it serves **both** hosts from one source:
|
|
74
|
+
`{gjs: polyfill, node: polyfill}`. That matters beyond portability — macOS and
|
|
75
|
+
Windows have no GJS host for this pillar at all, so Node is the *only* host on
|
|
76
|
+
which [ADR 0022](https://github.com/gjsify/gjsify/blob/main/docs/adr/0022-webkit-on-darwin.md)'s
|
|
77
|
+
darwin backend and
|
|
78
|
+
[ADR 0035](https://github.com/gjsify/gjsify/blob/main/docs/adr/0035-web-view-on-win32.md)'s
|
|
79
|
+
WebView2 backend can be reached. The `node` slot was `"none"` until it was
|
|
80
|
+
measured; the amendment is ADR 0022 § *Amendment — the `node` slot*.
|
|
81
|
+
|
|
82
|
+
`node: "polyfill"` describes the `gjsify build --app node` path, which is where
|
|
83
|
+
the `gi://` specifiers are rewritten. Importing the published `lib/esm` straight
|
|
84
|
+
out of `node_modules` is not that path and does not work — Node has no loader for
|
|
85
|
+
the `gi:` scheme.
|
|
86
|
+
|
|
87
|
+
`browser` and `nativescript` stay `none` and that is a different kind of claim: on
|
|
88
|
+
those two targets `gi://` is substituted with `{}`, so a wrong declaration fails
|
|
89
|
+
silently rather than at module load.
|
|
90
|
+
|
|
91
|
+
The Node leg is `gjsify run test:gjs-on-node` — the SAME suite the GJS leg runs,
|
|
92
|
+
built `--app node` and executed over the reverse bridge, so a gjs-green/node-red
|
|
93
|
+
diff is attributable
|
|
94
|
+
([ADR 0030](https://github.com/gjsify/gjsify/blob/main/docs/adr/0030-one-corpus-gjs-as-oracle.md)).
|
|
95
|
+
Both legs run every test in the suite, `/register` included; neither stands down.
|
|
96
|
+
The same bundle also runs green on Bun and Deno — one `--app node` bundle serves
|
|
97
|
+
all three Node-API hosts — which is why the register gate names all four runtimes
|
|
98
|
+
rather than only the one CI happens to invoke.
|
|
99
|
+
|
|
100
|
+
One import spelling is load-bearing rather than incidental: the ports come from
|
|
101
|
+
`@gjsify/message-channel/core`, not from the bare package. That package declares
|
|
102
|
+
`node: "native"`, so the bare specifier routes to the host's own `MessageChannel`
|
|
103
|
+
— which has no transport hook, no `_partner`, and reports `Symbol.toStringTag`
|
|
104
|
+
`EventTarget`. The WebKit bridge needs all three, so on the node target the bare
|
|
105
|
+
specifier broke port transfer outright. `./core` is the same implementation at a
|
|
106
|
+
specifier slot routing does not rewrite.
|
|
107
|
+
|
|
69
108
|
## License
|
|
70
109
|
|
|
71
110
|
MIT
|
package/lib/esm/iframe-bridge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{buildClickElementExpression as e,buildGetLinksExpression as t,buildQueryDomExpression as n}from"./dom-queries.js";import{buildEvalScript as r,parseEvalResult as i}from"./eval.js";import{iframeWidget as a,windowProxy as o}from"./property-symbol.js";import{HTMLIFrameElement as s}from"./html-iframe-element.js";import{IFrameWindowProxy as c}from"./iframe-window-proxy.js";import"./promisify.js";import{MessageBridge as l}from"./message-bridge.js";import{Document as u,notifyElementResize as d}from"@gjsify/dom-elements";import f from"gi://GLib?version=2.0";import p from"gi://GObject";import m from"gi://WebKit?version=6.0";const h=p.registerClass({GTypeName:`GjsifyIFrameBridge`},class IFrameBridge extends m.WebView{constructor(e){let{enableDeveloperExtras:t,enableJavascript:n,captureConsole:r,...i}=e??{},u=new m.UserContentManager,d=new m.Settings;d.enable_javascript=n??!0,d.enable_developer_extras=t??!0,super({...i,user_content_manager:u,settings:d}),this._readyCallbacks=[],this._navigationWaiters=[],this._lastLoadError=null,this._loadErrorCallbacks=[],this._options={enableDeveloperExtras:t,enableJavascript:n,captureConsole:r},this._iframe=new s,this._iframe[a]=this,this._messageBridge=new l(this,{captureConsole:r});let f=new c(this._messageBridge);this._iframe[o]=f,this._messageBridge.setWindowProxy(f),this.connect(`load-changed`,(e,t)=>{switch(t){case m.LoadEvent.STARTED:this._lastLoadError=null;break;case m.LoadEvent.COMMITTED:{let e=this.get_uri();e&&this._messageBridge.updateUri(e);break}case m.LoadEvent.FINISHED:this._iframe._onLoad();for(let e of this._readyCallbacks)e(this._iframe);this._readyCallbacks=[],this._settleNavigationWaiters(null);break}}),this.connect(`load-failed`,(e,t,n,r)=>{let i={uri:n,message:r?.message??`load failed`};this._lastLoadError=i;for(let e of this._loadErrorCallbacks)e(i);return this._iframe._onError(),this._settleNavigationWaiters(Error(`load failed for ${n}: ${i.message}`)),!1}),this.connect(`unrealize`,()=>{this._messageBridge.destroy();let e=this._iframe[o];e&&e._close(),this._iframe[a]=null,this._iframe[o]=null})}vfunc_size_allocate(e,t,n){super.vfunc_size_allocate(e,t,n),d(this._iframe,e,t)}get iframeElement(){return this._iframe}onReady(e){this._readyCallbacks.push(e)}loadUri(e){this._iframe.setAttribute(`src`,e),this.load_uri(e)}loadHtml(e,t){this._iframe.setAttribute(`srcdoc`,e),this.load_html(e,t??`about:srcdoc`)}postMessage(e,t=`*`){this._messageBridge.sendToWebView(e,t)}goBack(){this.go_back()}goForward(){this.go_forward()}get canGoBack(){return this.can_go_back()}get canGoForward(){return this.can_go_forward()}get currentUri(){return this.get_uri()??`about:blank`}get pageTitle(){return this.get_title()??``}get lastLoadError(){return this._lastLoadError}onLoadError(e){this._loadErrorCallbacks.push(e)}async evaluateJavaScript(e){return i((await this.evaluate_javascript(r(e),-1,null,null,null))?.to_string()??null)}async takeScreenshot(e=`full`){let t=e===`visible`?m.SnapshotRegion.VISIBLE:m.SnapshotRegion.FULL_DOCUMENT,n=(await this.get_snapshot(t,m.SnapshotOptions.NONE,null)).save_to_png_bytes().get_data();return n?new Uint8Array(n):new Uint8Array}waitForNavigation(e=3e4){return new Promise((t,n)=>{let r={resolve:t,reject:n,sourceId:null};e>0&&(r.sourceId=f.timeout_add(f.PRIORITY_DEFAULT,e,()=>{let t=this._navigationWaiters.indexOf(r);return t!==-1&&this._navigationWaiters.splice(t,1),r.sourceId=null,n(Error(`waitForNavigation: timed out after ${e}ms`)),f.SOURCE_REMOVE})),this._navigationWaiters.push(r)})}_settleNavigationWaiters(e){if(this._navigationWaiters.length===0)return;let t=this._navigationWaiters;this._navigationWaiters=[];for(let n of t)n.sourceId!==null&&(f.source_remove(n.sourceId),n.sourceId=null),e?n.reject(e):n.resolve()}getViewportSize(){return{width:this.get_allocated_width(),height:this.get_allocated_height()}}setViewportSize(e,t){this.set_size_request(e,t)}getConsoleLogs(){return this._messageBridge.getConsoleLogs()}clearConsoleLogs(){this._messageBridge.clearConsoleLogs()}onConsole(e){this._messageBridge.onConsole(e)}async getLinks(){let e=await this.evaluateJavaScript(t());return Array.isArray(e)?e:[]}async queryDom(e,t=200){let r=await this.evaluateJavaScript(n(e,t));return Array.isArray(r)?r:[]}async clickElement(t){return await this.evaluateJavaScript(e(t))===!0}installGlobals(){u.registerElementFactory(`iframe`,()=>new s),Object.defineProperty(globalThis,"HTMLIFrameElement",{value:s,writable:!0,configurable:!0})}});export{h as IFrameBridge};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{buildClickElementExpression as e,buildGetLinksExpression as t,buildQueryDomExpression as n}from"./dom-queries.js";import{buildEvalScript as r,parseEvalResult as i}from"./eval.js";import{iframeWidget as a,windowProxy as o}from"./property-symbol.js";import{HTMLIFrameElement as s}from"./html-iframe-element.js";import{IFrameWindowProxy as c}from"./iframe-window-proxy.js";import"./promisify.js";import{MessageBridge as l}from"./message-bridge.js";import{Document as u,notifyElementResize as d}from"@gjsify/dom-elements";import f from"gi://GLib?version=2.0";import p from"gi://GObject?version=2.0";import m from"gi://WebKit?version=6.0";const h=p.registerClass({GTypeName:`GjsifyIFrameBridge`},class IFrameBridge extends m.WebView{constructor(e){let{enableDeveloperExtras:t,enableJavascript:n,captureConsole:r,...i}=e??{},u=new m.UserContentManager,d=new m.Settings;d.enable_javascript=n??!0,d.enable_developer_extras=t??!0,super({...i,user_content_manager:u,settings:d}),this._readyCallbacks=[],this._navigationWaiters=[],this._lastLoadError=null,this._loadErrorCallbacks=[],this._options={enableDeveloperExtras:t,enableJavascript:n,captureConsole:r},this._iframe=new s,this._iframe[a]=this,this._messageBridge=new l(this,{captureConsole:r});let f=new c(this._messageBridge);this._iframe[o]=f,this._messageBridge.setWindowProxy(f),this.connect(`load-changed`,(e,t)=>{switch(t){case m.LoadEvent.STARTED:this._lastLoadError=null;break;case m.LoadEvent.COMMITTED:{let e=this.get_uri();e&&this._messageBridge.updateUri(e);break}case m.LoadEvent.FINISHED:this._iframe._onLoad();for(let e of this._readyCallbacks)e(this._iframe);this._readyCallbacks=[],this._settleNavigationWaiters(null);break}}),this.connect(`load-failed`,(e,t,n,r)=>{let i={uri:n,message:r?.message??`load failed`};this._lastLoadError=i;for(let e of this._loadErrorCallbacks)e(i);return this._iframe._onError(),this._settleNavigationWaiters(Error(`load failed for ${n}: ${i.message}`)),!1}),this.connect(`unrealize`,()=>{this._messageBridge.destroy();let e=this._iframe[o];e&&e._close(),this._iframe[a]=null,this._iframe[o]=null})}vfunc_size_allocate(e,t,n){super.vfunc_size_allocate(e,t,n),d(this._iframe,e,t)}get iframeElement(){return this._iframe}onReady(e){this._readyCallbacks.push(e)}loadUri(e){this._iframe.setAttribute(`src`,e),this.load_uri(e)}loadHtml(e,t){this._iframe.setAttribute(`srcdoc`,e),this.load_html(e,t??`about:srcdoc`)}postMessage(e,t=`*`){this._messageBridge.sendToWebView(e,t)}goBack(){this.go_back()}goForward(){this.go_forward()}get canGoBack(){return this.can_go_back()}get canGoForward(){return this.can_go_forward()}get currentUri(){return this.get_uri()??`about:blank`}get pageTitle(){return this.get_title()??``}get lastLoadError(){return this._lastLoadError}onLoadError(e){this._loadErrorCallbacks.push(e)}async evaluateJavaScript(e){return i((await this.evaluate_javascript(r(e),-1,null,null,null))?.to_string()??null)}async takeScreenshot(e=`full`){let t=e===`visible`?m.SnapshotRegion.VISIBLE:m.SnapshotRegion.FULL_DOCUMENT,n=(await this.get_snapshot(t,m.SnapshotOptions.NONE,null)).save_to_png_bytes().get_data();return n?new Uint8Array(n):new Uint8Array}waitForNavigation(e=3e4){return new Promise((t,n)=>{let r={resolve:t,reject:n,sourceId:null};e>0&&(r.sourceId=f.timeout_add(f.PRIORITY_DEFAULT,e,()=>{let t=this._navigationWaiters.indexOf(r);return t!==-1&&this._navigationWaiters.splice(t,1),r.sourceId=null,n(Error(`waitForNavigation: timed out after ${e}ms`)),f.SOURCE_REMOVE})),this._navigationWaiters.push(r)})}_settleNavigationWaiters(e){if(this._navigationWaiters.length===0)return;let t=this._navigationWaiters;this._navigationWaiters=[];for(let n of t)n.sourceId!==null&&(f.source_remove(n.sourceId),n.sourceId=null),e?n.reject(e):n.resolve()}getViewportSize(){return{width:this.get_allocated_width(),height:this.get_allocated_height()}}setViewportSize(e,t){this.set_size_request(e,t)}getConsoleLogs(){return this._messageBridge.getConsoleLogs()}clearConsoleLogs(){this._messageBridge.clearConsoleLogs()}onConsole(e){this._messageBridge.onConsole(e)}async getLinks(){let e=await this.evaluateJavaScript(t());return Array.isArray(e)?e:[]}async queryDom(e,t=200){let r=await this.evaluateJavaScript(n(e,t));return Array.isArray(r)?r:[]}async clickElement(t){return await this.evaluateJavaScript(e(t))===!0}installGlobals(){u.registerElementFactory(`iframe`,()=>new s),Object.defineProperty(globalThis,"HTMLIFrameElement",{value:s,writable:!0,configurable:!0})}});export{h as IFrameBridge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{MessageChannel as e,MessagePort as t}from"@gjsify/message-channel";const n=t,r=e;var BridgePortTransport=class{constructor(e){this._bridge=e}send(e,t){this._bridge._sendPortMessage(e,t)}close(e){this._bridge._closePort(e)}};export{BridgePortTransport,r as IFrameMessageChannel,n as IFrameMessagePort,e as MessageChannel,t as MessagePort};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{MessageChannel as e,MessagePort as t}from"@gjsify/message-channel/core";const n=t,r=e;var BridgePortTransport=class{constructor(e){this._bridge=e}send(e,t){this._bridge._sendPortMessage(e,t)}close(e){this._bridge._closePort(e)}};export{BridgePortTransport,r as IFrameMessageChannel,n as IFrameMessagePort,e as MessageChannel,t as MessagePort};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import GLib from 'gi://GLib?version=2.0';
|
|
2
|
-
import GObject from 'gi://GObject';
|
|
2
|
+
import GObject from 'gi://GObject?version=2.0';
|
|
3
3
|
import WebKit from 'gi://WebKit?version=6.0';
|
|
4
4
|
import { type ElementInfo, type LinkInfo } from './dom-queries.js';
|
|
5
5
|
import { HTMLIFrameElement } from './html-iframe-element.js';
|
|
@@ -184,12 +184,16 @@ export declare const IFrameBridge: {
|
|
|
184
184
|
get isPlayingAudio(): boolean;
|
|
185
185
|
get is_web_process_responsive(): boolean;
|
|
186
186
|
get isWebProcessResponsive(): boolean;
|
|
187
|
+
get magnification(): number;
|
|
188
|
+
set magnification(val: number);
|
|
187
189
|
get microphone_capture_state(): WebKit.MediaCaptureState;
|
|
188
190
|
set microphone_capture_state(val: WebKit.MediaCaptureState);
|
|
189
191
|
get microphoneCaptureState(): WebKit.MediaCaptureState;
|
|
190
192
|
set microphoneCaptureState(val: WebKit.MediaCaptureState);
|
|
191
193
|
get network_session(): WebKit.NetworkSession;
|
|
192
194
|
get networkSession(): WebKit.NetworkSession;
|
|
195
|
+
get page_icons(): WebKit.ImageList | null;
|
|
196
|
+
get pageIcons(): WebKit.ImageList | null;
|
|
193
197
|
get page_id(): number;
|
|
194
198
|
get pageId(): number;
|
|
195
199
|
set related_view(val: WebKit.WebView);
|
|
@@ -280,9 +284,11 @@ export declare const IFrameBridge: {
|
|
|
280
284
|
get_inspector(): WebKit.WebInspector;
|
|
281
285
|
get_is_muted(): boolean;
|
|
282
286
|
get_is_web_process_responsive(): boolean;
|
|
287
|
+
get_magnification(): number;
|
|
283
288
|
get_main_resource(): WebKit.WebResource;
|
|
284
289
|
get_microphone_capture_state(): WebKit.MediaCaptureState;
|
|
285
290
|
get_network_session(): WebKit.NetworkSession;
|
|
291
|
+
get_page_icons(): WebKit.ImageList | null;
|
|
286
292
|
get_page_id(): number;
|
|
287
293
|
get_session_state(): WebKit.WebViewSessionState;
|
|
288
294
|
get_settings(): WebKit.Settings;
|
|
@@ -334,6 +340,7 @@ export declare const IFrameBridge: {
|
|
|
334
340
|
set_editable(editable: boolean): void;
|
|
335
341
|
set_input_method_context(context: WebKit.InputMethodContext | null): void;
|
|
336
342
|
set_is_muted(muted: boolean): void;
|
|
343
|
+
set_magnification(magnification: number): void;
|
|
337
344
|
set_microphone_capture_state(state: WebKit.MediaCaptureState): void;
|
|
338
345
|
set_settings(settings: WebKit.Settings): void;
|
|
339
346
|
set_zoom_level(zoom_level: number): void;
|
|
@@ -866,12 +873,16 @@ export declare const IFrameBridge: {
|
|
|
866
873
|
get isPlayingAudio(): boolean;
|
|
867
874
|
get is_web_process_responsive(): boolean;
|
|
868
875
|
get isWebProcessResponsive(): boolean;
|
|
876
|
+
get magnification(): number;
|
|
877
|
+
set magnification(val: number);
|
|
869
878
|
get microphone_capture_state(): WebKit.MediaCaptureState;
|
|
870
879
|
set microphone_capture_state(val: WebKit.MediaCaptureState);
|
|
871
880
|
get microphoneCaptureState(): WebKit.MediaCaptureState;
|
|
872
881
|
set microphoneCaptureState(val: WebKit.MediaCaptureState);
|
|
873
882
|
get network_session(): WebKit.NetworkSession;
|
|
874
883
|
get networkSession(): WebKit.NetworkSession;
|
|
884
|
+
get page_icons(): WebKit.ImageList | null;
|
|
885
|
+
get pageIcons(): WebKit.ImageList | null;
|
|
875
886
|
get page_id(): number;
|
|
876
887
|
get pageId(): number;
|
|
877
888
|
set related_view(val: WebKit.WebView);
|
|
@@ -962,9 +973,11 @@ export declare const IFrameBridge: {
|
|
|
962
973
|
get_inspector(): WebKit.WebInspector;
|
|
963
974
|
get_is_muted(): boolean;
|
|
964
975
|
get_is_web_process_responsive(): boolean;
|
|
976
|
+
get_magnification(): number;
|
|
965
977
|
get_main_resource(): WebKit.WebResource;
|
|
966
978
|
get_microphone_capture_state(): WebKit.MediaCaptureState;
|
|
967
979
|
get_network_session(): WebKit.NetworkSession;
|
|
980
|
+
get_page_icons(): WebKit.ImageList | null;
|
|
968
981
|
get_page_id(): number;
|
|
969
982
|
get_session_state(): WebKit.WebViewSessionState;
|
|
970
983
|
get_settings(): WebKit.Settings;
|
|
@@ -1016,6 +1029,7 @@ export declare const IFrameBridge: {
|
|
|
1016
1029
|
set_editable(editable: boolean): void;
|
|
1017
1030
|
set_input_method_context(context: WebKit.InputMethodContext | null): void;
|
|
1018
1031
|
set_is_muted(muted: boolean): void;
|
|
1032
|
+
set_magnification(magnification: number): void;
|
|
1019
1033
|
set_microphone_capture_state(state: WebKit.MediaCaptureState): void;
|
|
1020
1034
|
set_settings(settings: WebKit.Settings): void;
|
|
1021
1035
|
set_zoom_level(zoom_level: number): void;
|
|
@@ -1548,12 +1562,16 @@ export declare const IFrameBridge: {
|
|
|
1548
1562
|
get isPlayingAudio(): boolean;
|
|
1549
1563
|
get is_web_process_responsive(): boolean;
|
|
1550
1564
|
get isWebProcessResponsive(): boolean;
|
|
1565
|
+
get magnification(): number;
|
|
1566
|
+
set magnification(val: number);
|
|
1551
1567
|
get microphone_capture_state(): WebKit.MediaCaptureState;
|
|
1552
1568
|
set microphone_capture_state(val: WebKit.MediaCaptureState);
|
|
1553
1569
|
get microphoneCaptureState(): WebKit.MediaCaptureState;
|
|
1554
1570
|
set microphoneCaptureState(val: WebKit.MediaCaptureState);
|
|
1555
1571
|
get network_session(): WebKit.NetworkSession;
|
|
1556
1572
|
get networkSession(): WebKit.NetworkSession;
|
|
1573
|
+
get page_icons(): WebKit.ImageList | null;
|
|
1574
|
+
get pageIcons(): WebKit.ImageList | null;
|
|
1557
1575
|
get page_id(): number;
|
|
1558
1576
|
get pageId(): number;
|
|
1559
1577
|
set related_view(val: WebKit.WebView);
|
|
@@ -1644,9 +1662,11 @@ export declare const IFrameBridge: {
|
|
|
1644
1662
|
get_inspector(): WebKit.WebInspector;
|
|
1645
1663
|
get_is_muted(): boolean;
|
|
1646
1664
|
get_is_web_process_responsive(): boolean;
|
|
1665
|
+
get_magnification(): number;
|
|
1647
1666
|
get_main_resource(): WebKit.WebResource;
|
|
1648
1667
|
get_microphone_capture_state(): WebKit.MediaCaptureState;
|
|
1649
1668
|
get_network_session(): WebKit.NetworkSession;
|
|
1669
|
+
get_page_icons(): WebKit.ImageList | null;
|
|
1650
1670
|
get_page_id(): number;
|
|
1651
1671
|
get_session_state(): WebKit.WebViewSessionState;
|
|
1652
1672
|
get_settings(): WebKit.Settings;
|
|
@@ -1698,6 +1718,7 @@ export declare const IFrameBridge: {
|
|
|
1698
1718
|
set_editable(editable: boolean): void;
|
|
1699
1719
|
set_input_method_context(context: WebKit.InputMethodContext | null): void;
|
|
1700
1720
|
set_is_muted(muted: boolean): void;
|
|
1721
|
+
set_magnification(magnification: number): void;
|
|
1701
1722
|
set_microphone_capture_state(state: WebKit.MediaCaptureState): void;
|
|
1702
1723
|
set_settings(settings: WebKit.Settings): void;
|
|
1703
1724
|
set_zoom_level(zoom_level: number): void;
|
|
@@ -2230,12 +2251,16 @@ export declare const IFrameBridge: {
|
|
|
2230
2251
|
get isPlayingAudio(): boolean;
|
|
2231
2252
|
get is_web_process_responsive(): boolean;
|
|
2232
2253
|
get isWebProcessResponsive(): boolean;
|
|
2254
|
+
get magnification(): number;
|
|
2255
|
+
set magnification(val: number);
|
|
2233
2256
|
get microphone_capture_state(): WebKit.MediaCaptureState;
|
|
2234
2257
|
set microphone_capture_state(val: WebKit.MediaCaptureState);
|
|
2235
2258
|
get microphoneCaptureState(): WebKit.MediaCaptureState;
|
|
2236
2259
|
set microphoneCaptureState(val: WebKit.MediaCaptureState);
|
|
2237
2260
|
get network_session(): WebKit.NetworkSession;
|
|
2238
2261
|
get networkSession(): WebKit.NetworkSession;
|
|
2262
|
+
get page_icons(): WebKit.ImageList | null;
|
|
2263
|
+
get pageIcons(): WebKit.ImageList | null;
|
|
2239
2264
|
get page_id(): number;
|
|
2240
2265
|
get pageId(): number;
|
|
2241
2266
|
set related_view(val: WebKit.WebView);
|
|
@@ -2326,9 +2351,11 @@ export declare const IFrameBridge: {
|
|
|
2326
2351
|
get_inspector(): WebKit.WebInspector;
|
|
2327
2352
|
get_is_muted(): boolean;
|
|
2328
2353
|
get_is_web_process_responsive(): boolean;
|
|
2354
|
+
get_magnification(): number;
|
|
2329
2355
|
get_main_resource(): WebKit.WebResource;
|
|
2330
2356
|
get_microphone_capture_state(): WebKit.MediaCaptureState;
|
|
2331
2357
|
get_network_session(): WebKit.NetworkSession;
|
|
2358
|
+
get_page_icons(): WebKit.ImageList | null;
|
|
2332
2359
|
get_page_id(): number;
|
|
2333
2360
|
get_session_state(): WebKit.WebViewSessionState;
|
|
2334
2361
|
get_settings(): WebKit.Settings;
|
|
@@ -2380,6 +2407,7 @@ export declare const IFrameBridge: {
|
|
|
2380
2407
|
set_editable(editable: boolean): void;
|
|
2381
2408
|
set_input_method_context(context: WebKit.InputMethodContext | null): void;
|
|
2382
2409
|
set_is_muted(muted: boolean): void;
|
|
2410
|
+
set_magnification(magnification: number): void;
|
|
2383
2411
|
set_microphone_capture_state(state: WebKit.MediaCaptureState): void;
|
|
2384
2412
|
set_settings(settings: WebKit.Settings): void;
|
|
2385
2413
|
set_zoom_level(zoom_level: number): void;
|
|
@@ -2912,12 +2940,16 @@ export declare const IFrameBridge: {
|
|
|
2912
2940
|
get isPlayingAudio(): boolean;
|
|
2913
2941
|
get is_web_process_responsive(): boolean;
|
|
2914
2942
|
get isWebProcessResponsive(): boolean;
|
|
2943
|
+
get magnification(): number;
|
|
2944
|
+
set magnification(val: number);
|
|
2915
2945
|
get microphone_capture_state(): WebKit.MediaCaptureState;
|
|
2916
2946
|
set microphone_capture_state(val: WebKit.MediaCaptureState);
|
|
2917
2947
|
get microphoneCaptureState(): WebKit.MediaCaptureState;
|
|
2918
2948
|
set microphoneCaptureState(val: WebKit.MediaCaptureState);
|
|
2919
2949
|
get network_session(): WebKit.NetworkSession;
|
|
2920
2950
|
get networkSession(): WebKit.NetworkSession;
|
|
2951
|
+
get page_icons(): WebKit.ImageList | null;
|
|
2952
|
+
get pageIcons(): WebKit.ImageList | null;
|
|
2921
2953
|
get page_id(): number;
|
|
2922
2954
|
get pageId(): number;
|
|
2923
2955
|
set related_view(val: WebKit.WebView);
|
|
@@ -3008,9 +3040,11 @@ export declare const IFrameBridge: {
|
|
|
3008
3040
|
get_inspector(): WebKit.WebInspector;
|
|
3009
3041
|
get_is_muted(): boolean;
|
|
3010
3042
|
get_is_web_process_responsive(): boolean;
|
|
3043
|
+
get_magnification(): number;
|
|
3011
3044
|
get_main_resource(): WebKit.WebResource;
|
|
3012
3045
|
get_microphone_capture_state(): WebKit.MediaCaptureState;
|
|
3013
3046
|
get_network_session(): WebKit.NetworkSession;
|
|
3047
|
+
get_page_icons(): WebKit.ImageList | null;
|
|
3014
3048
|
get_page_id(): number;
|
|
3015
3049
|
get_session_state(): WebKit.WebViewSessionState;
|
|
3016
3050
|
get_settings(): WebKit.Settings;
|
|
@@ -3062,6 +3096,7 @@ export declare const IFrameBridge: {
|
|
|
3062
3096
|
set_editable(editable: boolean): void;
|
|
3063
3097
|
set_input_method_context(context: WebKit.InputMethodContext | null): void;
|
|
3064
3098
|
set_is_muted(muted: boolean): void;
|
|
3099
|
+
set_magnification(magnification: number): void;
|
|
3065
3100
|
set_microphone_capture_state(state: WebKit.MediaCaptureState): void;
|
|
3066
3101
|
set_settings(settings: WebKit.Settings): void;
|
|
3067
3102
|
set_zoom_level(zoom_level: number): void;
|
|
@@ -3594,12 +3629,16 @@ export declare const IFrameBridge: {
|
|
|
3594
3629
|
get isPlayingAudio(): boolean;
|
|
3595
3630
|
get is_web_process_responsive(): boolean;
|
|
3596
3631
|
get isWebProcessResponsive(): boolean;
|
|
3632
|
+
get magnification(): number;
|
|
3633
|
+
set magnification(val: number);
|
|
3597
3634
|
get microphone_capture_state(): WebKit.MediaCaptureState;
|
|
3598
3635
|
set microphone_capture_state(val: WebKit.MediaCaptureState);
|
|
3599
3636
|
get microphoneCaptureState(): WebKit.MediaCaptureState;
|
|
3600
3637
|
set microphoneCaptureState(val: WebKit.MediaCaptureState);
|
|
3601
3638
|
get network_session(): WebKit.NetworkSession;
|
|
3602
3639
|
get networkSession(): WebKit.NetworkSession;
|
|
3640
|
+
get page_icons(): WebKit.ImageList | null;
|
|
3641
|
+
get pageIcons(): WebKit.ImageList | null;
|
|
3603
3642
|
get page_id(): number;
|
|
3604
3643
|
get pageId(): number;
|
|
3605
3644
|
set related_view(val: WebKit.WebView);
|
|
@@ -3690,9 +3729,11 @@ export declare const IFrameBridge: {
|
|
|
3690
3729
|
get_inspector(): WebKit.WebInspector;
|
|
3691
3730
|
get_is_muted(): boolean;
|
|
3692
3731
|
get_is_web_process_responsive(): boolean;
|
|
3732
|
+
get_magnification(): number;
|
|
3693
3733
|
get_main_resource(): WebKit.WebResource;
|
|
3694
3734
|
get_microphone_capture_state(): WebKit.MediaCaptureState;
|
|
3695
3735
|
get_network_session(): WebKit.NetworkSession;
|
|
3736
|
+
get_page_icons(): WebKit.ImageList | null;
|
|
3696
3737
|
get_page_id(): number;
|
|
3697
3738
|
get_session_state(): WebKit.WebViewSessionState;
|
|
3698
3739
|
get_settings(): WebKit.Settings;
|
|
@@ -3744,6 +3785,7 @@ export declare const IFrameBridge: {
|
|
|
3744
3785
|
set_editable(editable: boolean): void;
|
|
3745
3786
|
set_input_method_context(context: WebKit.InputMethodContext | null): void;
|
|
3746
3787
|
set_is_muted(muted: boolean): void;
|
|
3788
|
+
set_magnification(magnification: number): void;
|
|
3747
3789
|
set_microphone_capture_state(state: WebKit.MediaCaptureState): void;
|
|
3748
3790
|
set_settings(settings: WebKit.Settings): void;
|
|
3749
3791
|
set_zoom_level(zoom_level: number): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MessagePort, MessageChannel } from '@gjsify/message-channel';
|
|
2
|
-
import type { MessagePortTransport } from '@gjsify/message-channel';
|
|
1
|
+
import { MessagePort, MessageChannel } from '@gjsify/message-channel/core';
|
|
2
|
+
import type { MessagePortTransport } from '@gjsify/message-channel/core';
|
|
3
3
|
import type { MessageBridge } from './message-bridge.js';
|
|
4
4
|
export { MessagePort, MessageChannel };
|
|
5
5
|
/** @deprecated Alias of `MessagePort`; use the standard name. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventTarget } from '@gjsify/dom-events';
|
|
2
2
|
import type { MessageBridge } from './message-bridge.js';
|
|
3
|
-
import type { MessagePort } from '@gjsify/message-channel';
|
|
3
|
+
import type { MessagePort } from '@gjsify/message-channel/core';
|
|
4
4
|
/**
|
|
5
5
|
* Deliberately NOT a full BrowserWindow: only the subset of the Window API that
|
|
6
6
|
* postMessage-based iframe communication needs.
|
|
@@ -2,7 +2,7 @@ import WebKit from 'gi://WebKit?version=6.0';
|
|
|
2
2
|
import './promisify.js';
|
|
3
3
|
import type { IFrameWindowProxy } from './iframe-window-proxy.js';
|
|
4
4
|
import type { ConsoleCallback, ConsoleLogEntry } from './types/index.js';
|
|
5
|
-
import type { MessagePort } from '@gjsify/message-channel';
|
|
5
|
+
import type { MessagePort } from '@gjsify/message-channel/core';
|
|
6
6
|
/** Options for {@link MessageBridge}. */
|
|
7
7
|
export interface MessageBridgeOptions {
|
|
8
8
|
/** Forward the page's `console.*` to the host via a UserScript. Default: false. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/iframe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "HTMLIFrameElement for GJS, backed by WebKit.WebView",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -30,8 +30,10 @@
|
|
|
30
30
|
"build:types": "gjsify tsc",
|
|
31
31
|
"build:test": "gjsify run build:test:gjs",
|
|
32
32
|
"build:test:gjs": "gjsify build src/test.mts --app gjs --outfile test.gjs.mjs",
|
|
33
|
+
"build:test:node": "gjsify build src/test.mts --app node --outfile dist/test.node.mjs",
|
|
33
34
|
"test": "gjsify run build:gjsify && gjsify run build:test && gjsify run test:gjs",
|
|
34
|
-
"test:gjs": "gjsify run test.gjs.mjs"
|
|
35
|
+
"test:gjs": "gjsify run test.gjs.mjs",
|
|
36
|
+
"test:gjs-on-node": "gjsify run build:gjsify && gjsify run build:test:node && node dist/test.node.mjs"
|
|
35
37
|
},
|
|
36
38
|
"keywords": [
|
|
37
39
|
"gjs",
|
|
@@ -41,26 +43,26 @@
|
|
|
41
43
|
"dom"
|
|
42
44
|
],
|
|
43
45
|
"dependencies": {
|
|
44
|
-
"@girs/gdkpixbuf-2.0": "
|
|
45
|
-
"@girs/gjs": "
|
|
46
|
-
"@girs/gtk-4.0": "
|
|
47
|
-
"@girs/javascriptcore-6.0": "
|
|
48
|
-
"@girs/webkit-6.0": "
|
|
49
|
-
"@gjsify/dom-elements": "^0.
|
|
50
|
-
"@gjsify/dom-events": "^0.
|
|
51
|
-
"@gjsify/message-channel": "^0.
|
|
52
|
-
"@gjsify/webkit-native": "^0.
|
|
46
|
+
"@girs/gdkpixbuf-2.0": "4.6.0",
|
|
47
|
+
"@girs/gjs": "4.6.0",
|
|
48
|
+
"@girs/gtk-4.0": "4.6.0",
|
|
49
|
+
"@girs/javascriptcore-6.0": "4.6.0",
|
|
50
|
+
"@girs/webkit-6.0": "4.6.0",
|
|
51
|
+
"@gjsify/dom-elements": "^0.46.0",
|
|
52
|
+
"@gjsify/dom-events": "^0.46.0",
|
|
53
|
+
"@gjsify/message-channel": "^0.46.0",
|
|
54
|
+
"@gjsify/webkit-native": "^0.46.0"
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
55
|
-
"@gjsify/cli": "^0.
|
|
56
|
-
"@gjsify/unit": "^0.
|
|
57
|
+
"@gjsify/cli": "^0.46.0",
|
|
58
|
+
"@gjsify/unit": "^0.46.0",
|
|
57
59
|
"@types/node": "^25.9.2",
|
|
58
60
|
"typescript": "^6.0.3"
|
|
59
61
|
},
|
|
60
62
|
"gjsify": {
|
|
61
63
|
"runtimes": {
|
|
62
64
|
"gjs": "polyfill",
|
|
63
|
-
"node": "
|
|
65
|
+
"node": "polyfill",
|
|
64
66
|
"browser": "none",
|
|
65
67
|
"nativescript": "none"
|
|
66
68
|
},
|