Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ The Chrome DevTools MCP server supports the following configuration option:
- **Type:** string

- **`--viewport`**
Initial viewport size for the Chrome instances started by the server. For example, `1280x720`
Initial viewport size for the Chrome instances started by the server. For example, `1280x720`. In headless mode, max size is 3840x2160px.
- **Type:** string

- **`--proxyServer`**
Expand Down
3 changes: 3 additions & 0 deletions src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export async function launch(options: McpLaunchOptions): Promise<Browser> {
if (customDevTools) {
args.push(`--custom-devtools-frontend=file://${customDevTools}`);
}
if (headless) {
args.push('--screen-info={3840x2160}');
}
let puppeteerChannel: ChromeReleaseChannel | undefined;
if (!executablePath) {
puppeteerChannel =
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const cliOptions = {
viewport: {
type: 'string',
describe:
'Initial viewport size for the Chrome instances started by the server. For example, `1280x720`',
'Initial viewport size for the Chrome instances started by the server. For example, `1280x720`. In headless mode, max size is 3840x2160px.',
coerce: (arg: string | undefined) => {
if (arg === undefined) {
return;
Expand Down
8 changes: 4 additions & 4 deletions tests/browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ describe('browser', () => {
userDataDir: folderPath,
executablePath: executablePath(),
viewport: {
width: 700,
height: 500,
width: 1501,
height: 801,
},
});
try {
Expand All @@ -62,8 +62,8 @@ describe('browser', () => {
return {width: window.innerWidth, height: window.innerHeight};
});
assert.deepStrictEqual(result, {
width: 700,
height: 500,
width: 1501,
height: 801,
});
} finally {
await browser.close();
Expand Down