Feature request: allow Agent Window to be created already minimized (chrome.windows.create state)

オープン
#649 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
backend, desktop

調査の方向性

Start by reading the window-creation helper in background.js and trace how session options reach it; the issue also identifies a tab-detach creation path with the same shape. Check the extension tests or existing coverage for window creation, then verify that a session configured to start minimized creates both windows minimized while page automation still works. The issue does not name a test file.

索引モデルが issue の本文から書いたものです。

説明

Summary

When a session is started with the default background mode (--no-focus), the Agent Window is still created as a normal, visible window. On a normal (non-fullscreen) desktop it paints its first frame — a white about:blank window — before any caller can react, so users see a brief white flash even when the automation immediately minimizes it.

Request: let the Agent Window be created in the minimized state, so it never exists as a visible normal window.

Environment

OS Windows 10 (18362)
Browser Microsoft Edge
Extension BrowserSkill 0.4.2 (Edge Add-ons build)
CLI bsk session start (default --no-focus)

Steps to reproduce

  1. Have a dark window in the foreground (e.g. a video player, windowed).
  2. Run bsk session start with the default background mode.
  3. Watch the screen.

Expected: nothing appears; the Agent Window only exists in the taskbar.

Actual: a white window frame flashes for a moment before the caller minimizes it.

Root cause

chrome.windows.create is called without a state field, in the window-creation helper of background.js:

const win = await chrome.windows.create({
  type: `normal`,
  focused: t.focused ?? !1,
  incognito: t.incognito ?? !1,
  url: e,
  ...(t.size ? { width: t.size.width, height: t.size.height } : {})
});

The tab-detach path has the same shape:

const id = (await this.api.windows.create({
  tabId: e, type: `normal`, focused: !1, ...(a.incognito ? { incognito: !0 } : {})
}))?.id;

focused: false only means "don't steal focus" — the window is still shown and composited. A caller can therefore only minimize it after windows.create resolves, and by then the first white frame may already have been presented. Measured latency from a polling caller is ~40 ms, which still lands on several vsync intervals and is clearly visible against dark content.

Proposed fix

chrome.windows.create already accepts state: "minimized":

const win = await chrome.windows.create({
  type: `normal`,
  focused: t.focused ?? !1,
  state: t.minimized ? `minimized` : undefined,   // <-- new
  incognito: t.incognito ?? !1,
  url: e,
  ...(t.size ? { width: t.size.width, height: t.size.height } : {})
});

Any of these interfaces would work:

  • Extension setting — "Open Agent Window minimized" (best: users opt in once, no CLI change needed).
  • CLI flag — bsk session start --minimized, forwarded to the extension.
  • New default — when --no-focus is used, create minimized unless --focus is explicitly requested.

Notes

  • A minimized window keeps its renderer alive: navigating, DOM queries, screenshots and sync all still work. Verified against 0.4.2 by minimizing an Agent Window externally and then driving the page normally.
  • The extension already performs the same transition elsewhere — the focus-restore helper after a task popup calls windows.update(id, { state: minimized }) — so the state change itself is known-good; only the create-time path is missing it.
  • If state at creation is not viable, a windows.update({state:'minimized'}) issued immediately after create (before returning) would also narrow the exposure window considerably, though create-time state is the clean fix.
主要言語
TypeScript
スター
10.1k
フォーク
732
平均マージ
1日 21時間
マージ済み PR(30日)
97

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Tencent/BrowserSkill のほかの issue

Tencent/BrowserSkill の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。