Skip to content

Commit 363b5e4

Browse files
authored
fix(mcp): browser navigate error (#218)
1 parent 698eef5 commit 363b5e4

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

apps/omega/resources/icon.icns

96.2 KB
Binary file not shown.

apps/omega/resources/icon.ico

42.5 KB
Binary file not shown.

packages/agent-infra/browser/src/local-browser.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ export class LocalBrowser extends BaseBrowser {
4545
height: viewportHeight,
4646
},
4747
args: [
48+
'--no-sandbox',
49+
'--disable-http2',
4850
'--disable-blink-features=AutomationControlled',
51+
'--disable-infobars',
52+
'--disable-background-timer-throttling',
53+
'--disable-popup-blocking',
54+
'--disable-backgrounding-occluded-windows',
55+
'--disable-renderer-backgrounding',
56+
'--disable-window-activation',
57+
'--disable-focus-on-load',
4958
`--window-size=${viewportWidth},${viewportHeight + 90}`,
5059
options?.proxy ? `--proxy-server=${options.proxy}` : '',
5160
options?.profilePath

packages/agent-infra/mcp-servers/browser/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ declare global {
3737

3838
setConfig({
3939
launchOptions: {
40-
headless: false,
40+
headless: true,
4141
},
4242
logger: {
4343
info: (...args: any[]) => {

packages/agent-infra/mcp-servers/browser/src/server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@ const handleToolCall: Client['callTool'] = async ({
377377
};
378378
}
379379

380+
// TODO: randomize user agent
381+
page?.setUserAgent(
382+
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
383+
);
384+
380385
const handlers: {
381386
[K in ToolNames]: (args: ToolInputMap[K]) => Promise<CallToolResult>;
382387
} = {

0 commit comments

Comments
 (0)