-
Notifications
You must be signed in to change notification settings - Fork 687
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When running browser commands (e.g., opencli bilibili hot), the extension fails to create the automation window
with the error:
[pre-nav] Failed to navigate to https://www.bilibili.com: Invalid value for state
Error: Invalid value for state
Steps to Reproduce
- Install opencli globally:
npm install -g @jackwener/opencli - Install the OpenCLI Browser Bridge extension in Chrome
- Run any browser command:
opencli bilibili hot - Observe the error
Expected Behavior
The automation window should be created successfully and the command should execute.
Actual Behavior
The command fails with Invalid value for state error.
Root Cause
In extension/src/background.ts, the getAutomationWindow() function creates a window with conflicting
parameters:
// Line 149-156
const win = await chrome.windows.create({
url: BLANK_PAGE,
focused: false, // ❌ Problem here
width: 1280,
height: 900,
type: 'normal',
state: 'minimized', // ❌ Conflicts with focused
});
According to https://developer.chrome.com/docs/extensions/reference/api/windows:
▎ focused: If true, brings the window to the front; cannot be combined with the state 'minimized'.
The focused parameter (whether true or false) cannot be used together with state: 'minimized'. This is a hard
constraint in Chrome's API.
### OpenCLI Version
1.5.2
### Node.js Version
22.x
### Operating System
Windows
### Logs / Screenshots
```shellReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working