@gjsify/devtools-browser 0.25.1 → 0.26.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.
Files changed (2) hide show
  1. package/lib/esm/run.js +1 -1
  2. package/package.json +6 -6
package/lib/esm/run.js CHANGED
@@ -1 +1 @@
1
- import"./_virtual/_rolldown/runtime.js";import{browserDevtoolsExtension as e}from"./browser-devtools-extension.js";import{BrowserWindow as t}from"./browser-window.js";import n from"@girs/adw-1";import r from"@girs/gio-2.0";import i from"@girs/glib-2.0";import a from"@girs/gobject-2.0";import{installDevtools as o}from"@gjsify/devtools";import{inspectorProtocolExtension as s}from"@gjsify/devtools-cdp";var c=class BrowserApplication extends n.Application{static{a.registerClass({GTypeName:`GjsifyBrowserApplication`},BrowserApplication)}constructor(e){super({application_id:e.applicationId,flags:r.ApplicationFlags.DEFAULT_FLAGS}),this._window=null,this._options=e,e.inspectorPort!==void 0&&i.setenv(`WEBKIT_INSPECTOR_HTTP_SERVER`,`127.0.0.1:${e.inspectorPort}`,!0),this.connect(`activate`,()=>this._onActivate())}_onActivate(){if(!this._window){this._window=new t(this,{title:this._options.title,homeUrl:this._options.homeUrl});let n=[e({bridge:this._window.bridge,core:this._window.core,window:this._window})];this._options.inspectorPort!==void 0&&(this._window.bridge.get_settings().set_enable_developer_extras(!0),n.push(s({port:this._options.inspectorPort}))),o(this,{enabled:this._options.devtools||void 0,winActionGroup:this._window.window,extend:n}),this._options.screenshot&&this._scheduleOneShot(this._options.screenshot)}this._window.present()}_scheduleOneShot(e){let t=this._window;if(!t)return;let n=!1,capture=()=>{n||(n=!0,i.timeout_add(i.PRIORITY_DEFAULT,500,()=>(t.bridge.takeScreenshot(`full`).then(t=>{i.file_set_contents(e,t),console.log(`[gjsify browse] screenshot → ${e} (${t.length} bytes)`),this.quit()}).catch(e=>{console.error(`[gjsify browse] screenshot failed: ${e}`),this.quit()}),i.SOURCE_REMOVE)))};t.core.onPageLoaded(()=>capture()),i.timeout_add_seconds(i.PRIORITY_DEFAULT,10,()=>(capture(),i.SOURCE_REMOVE))}};a.type_ensure(c.$gtype);async function runBrowserDevtools(e){return new c(e).runAsync([imports.system.programInvocationName,...ARGV])}export{c as BrowserApplication,runBrowserDevtools};
1
+ import"./_virtual/_rolldown/runtime.js";import{browserDevtoolsExtension as e}from"./browser-devtools-extension.js";import{BrowserWindow as t}from"./browser-window.js";import n from"@girs/adw-1";import r from"@girs/gio-2.0";import i from"@girs/glib-2.0";import a from"@girs/gobject-2.0";import o from"system";import{installDevtools as s}from"@gjsify/devtools";import{inspectorProtocolExtension as c}from"@gjsify/devtools-cdp";var l=class BrowserApplication extends n.Application{static{a.registerClass({GTypeName:`GjsifyBrowserApplication`},BrowserApplication)}constructor(e){super({application_id:e.applicationId,flags:r.ApplicationFlags.DEFAULT_FLAGS}),this._window=null,this._options=e,e.inspectorPort!==void 0&&i.setenv(`WEBKIT_INSPECTOR_HTTP_SERVER`,`127.0.0.1:${e.inspectorPort}`,!0),this.connect(`activate`,()=>this._onActivate())}_onActivate(){if(!this._window){this._window=new t(this,{title:this._options.title,homeUrl:this._options.homeUrl});let n=[e({bridge:this._window.bridge,core:this._window.core,window:this._window})];this._options.inspectorPort!==void 0&&(this._window.bridge.get_settings().set_enable_developer_extras(!0),n.push(c({port:this._options.inspectorPort}))),s(this,{enabled:this._options.devtools||void 0,winActionGroup:this._window.window,extend:n}),this._options.screenshot&&this._scheduleOneShot(this._options.screenshot)}this._window.present()}_scheduleOneShot(e){let t=this._window;if(!t)return;let n=!1,capture=()=>{n||(n=!0,i.timeout_add(i.PRIORITY_DEFAULT,500,()=>(t.bridge.takeScreenshot(`full`).then(t=>{i.file_set_contents(e,t),console.log(`[gjsify browse] screenshot → ${e} (${t.length} bytes)`),this.quit()}).catch(e=>{console.error(`[gjsify browse] screenshot failed: ${e}`),this.quit()}),i.SOURCE_REMOVE)))};t.core.onPageLoaded(()=>capture()),i.timeout_add_seconds(i.PRIORITY_DEFAULT,10,()=>(capture(),i.SOURCE_REMOVE))}};a.type_ensure(l.$gtype);async function runBrowserDevtools(e){return new l(e).runAsync([o.programInvocationName,...o.programArgs])}export{l as BrowserApplication,runBrowserDevtools};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/devtools-browser",
3
- "version": "0.25.1",
3
+ "version": "0.26.0",
4
4
  "description": "Minimalist Adwaita web browser for GJS — shared BrowserCore + native Adw shell + a devtools extension so an agent can drive and inspect web apps over MCP",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -41,13 +41,13 @@
41
41
  "@girs/gobject-2.0": "^4.1.0",
42
42
  "@girs/gtk-4.0": "^4.1.0",
43
43
  "@girs/webkit-6.0": "^4.1.0",
44
- "@gjsify/devtools": "^0.25.1",
45
- "@gjsify/devtools-cdp": "^0.25.1",
46
- "@gjsify/iframe": "^0.25.1"
44
+ "@gjsify/devtools": "^0.26.0",
45
+ "@gjsify/devtools-cdp": "^0.26.0",
46
+ "@gjsify/iframe": "^0.26.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@gjsify/cli": "^0.25.1",
50
- "@gjsify/unit": "^0.25.1",
49
+ "@gjsify/cli": "^0.26.0",
50
+ "@gjsify/unit": "^0.26.0",
51
51
  "@types/node": "^25.9.2",
52
52
  "typescript": "^6.0.3"
53
53
  },