autokap 1.3.23 → 1.3.24

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/dist/browser.js +25 -0
  2. package/package.json +1 -1
package/dist/browser.js CHANGED
@@ -954,6 +954,31 @@ export class Browser {
954
954
  }
955
955
  }, { styleId: CAPTURE_HIDE_STYLE_ID, css: getCaptureHideCSS() });
956
956
  instance.page = await instance.context.newPage();
957
+ // Cloud Run only: force the page window to fullscreen via CDP. The
958
+ // --kiosk launch flag is silently ignored by Chromium for windows
959
+ // created by Playwright via Target.createTarget (CDP) — kiosk only
960
+ // applies to the initial window opened by Chrome at startup, and
961
+ // Playwright doesn't open one (it uses --no-startup-window). Without
962
+ // explicit fullscreen, the CDP-created window has the full chrome UI
963
+ // (tab strip, address bar, omnibox, extension icons) which leaks into
964
+ // ffmpeg x11grab captures regardless of matchbox WM. Browser.setWindowBounds
965
+ // with windowState=fullscreen hides the chrome from the page side and
966
+ // matchbox honors the fullscreen request on the X side.
967
+ if (isLinuxWithGpu) {
968
+ try {
969
+ const cdp = await instance.context.newCDPSession(instance.page);
970
+ const { windowId } = await cdp.send('Browser.getWindowForTarget');
971
+ await cdp.send('Browser.setWindowBounds', {
972
+ windowId,
973
+ bounds: { windowState: 'fullscreen' },
974
+ });
975
+ logger.info(`[capture] Cloud clip capture: window ${windowId} forced to fullscreen via CDP`);
976
+ await cdp.detach().catch(() => undefined);
977
+ }
978
+ catch (err) {
979
+ logger.warn(`[capture] Cloud clip capture: CDP fullscreen request failed: ${err.message}`);
980
+ }
981
+ }
957
982
  // Cloud Run only: query the WebGL UNMASKED_RENDERER_WEBGL string once
958
983
  // per browser launch and log it. This is the source of truth for which
959
984
  // GPU backend Chromium picked — flag combinations alone are not enough,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autokap",
3
- "version": "1.3.23",
3
+ "version": "1.3.24",
4
4
  "description": "AI-powered CLI tool for capturing clean screenshots of websites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",