brave-real-browser-mcp-server 2.18.4 โ 2.18.5
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.
- package/README.md +0 -10
- package/dist/browser-manager.js +6 -54
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -165,15 +165,5 @@ PROXY_URL=http://user:pass@host:port
|
|
|
165
165
|
|
|
166
166
|
---
|
|
167
167
|
|
|
168
|
-
## ๐งช Testing
|
|
169
|
-
|
|
170
|
-
To run the End-to-End (E2E) tests for the project:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
npx vitest run test/e2e/visual-browser.test.ts --reporter=verbose 2>&1
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
168
|
## ๐ License
|
|
179
169
|
MIT License
|
package/dist/browser-manager.js
CHANGED
|
@@ -27,49 +27,6 @@ export function setPage(page) {
|
|
|
27
27
|
}
|
|
28
28
|
// Check environment variable for testing override
|
|
29
29
|
const disableContentPriority = process.env.DISABLE_CONTENT_PRIORITY === 'true' || process.env.NODE_ENV === 'test';
|
|
30
|
-
// ============================================
|
|
31
|
-
// HEADLESS CONFIGURATION - Single Source of Truth
|
|
32
|
-
// ============================================
|
|
33
|
-
// Control via environment variable: HEADLESS=true or HEADLESS=false
|
|
34
|
-
// ENV has HIGHEST PRIORITY - overrides any code/API settings
|
|
35
|
-
// Default: false (browser GUI visible) when ENV not set
|
|
36
|
-
const HEADLESS_ENV_SET = process.env.HEADLESS !== undefined;
|
|
37
|
-
export const IS_HEADLESS = process.env.HEADLESS === 'true';
|
|
38
|
-
// Helper: Get headless value (ENV always wins if set)
|
|
39
|
-
export const getHeadlessValue = (optionsHeadless) => {
|
|
40
|
-
if (HEADLESS_ENV_SET) {
|
|
41
|
-
return IS_HEADLESS; // ENV has highest priority
|
|
42
|
-
}
|
|
43
|
-
return optionsHeadless ?? false; // Fallback to options or false
|
|
44
|
-
};
|
|
45
|
-
// ============================================
|
|
46
|
-
// DISABLE_XVFB CONFIGURATION - Single Source of Truth
|
|
47
|
-
// ============================================
|
|
48
|
-
// Control via environment variable: DISABLE_XVFB=true or DISABLE_XVFB=false
|
|
49
|
-
// ENV has HIGHEST PRIORITY - overrides any code/API settings
|
|
50
|
-
// Default: true (Xvfb disabled) when ENV not set
|
|
51
|
-
const DISABLE_XVFB_ENV_SET = process.env.DISABLE_XVFB !== undefined;
|
|
52
|
-
export const IS_XVFB_DISABLED = process.env.DISABLE_XVFB !== 'false'; // Default true
|
|
53
|
-
// Helper: Get disableXvfb value (ENV always wins if set)
|
|
54
|
-
export const getDisableXvfbValue = (optionsDisableXvfb) => {
|
|
55
|
-
if (DISABLE_XVFB_ENV_SET) {
|
|
56
|
-
return IS_XVFB_DISABLED; // ENV has highest priority
|
|
57
|
-
}
|
|
58
|
-
return optionsDisableXvfb ?? true; // Fallback to options or true
|
|
59
|
-
};
|
|
60
|
-
// ============================================
|
|
61
|
-
// PROXY CONFIGURATION - Single Source of Truth
|
|
62
|
-
// ============================================
|
|
63
|
-
// Control via environment variable: PROXY_URL=http://proxy:8080
|
|
64
|
-
// ENV has HIGHEST PRIORITY - overrides any code/API settings
|
|
65
|
-
export const ENV_PROXY_URL = process.env.PROXY_URL || '';
|
|
66
|
-
// Helper: Get proxy value (ENV always wins if set)
|
|
67
|
-
export const getProxyValue = (optionsProxy) => {
|
|
68
|
-
if (ENV_PROXY_URL) {
|
|
69
|
-
return ENV_PROXY_URL; // ENV has highest priority
|
|
70
|
-
}
|
|
71
|
-
return optionsProxy; // Fallback to options
|
|
72
|
-
};
|
|
73
30
|
let contentPriorityConfig = {
|
|
74
31
|
prioritizeContent: !disableContentPriority,
|
|
75
32
|
autoSuggestGetContent: !disableContentPriority
|
|
@@ -533,10 +490,10 @@ export async function initializeBrowser(options) {
|
|
|
533
490
|
braveConfig.chromePath = detectedBravePath;
|
|
534
491
|
}
|
|
535
492
|
const connectOptions = {
|
|
536
|
-
headless:
|
|
493
|
+
headless: options?.headless ?? (process.env.HEADLESS === 'true'),
|
|
537
494
|
customConfig: braveConfig,
|
|
538
495
|
turnstile: true,
|
|
539
|
-
disableXvfb:
|
|
496
|
+
disableXvfb: options?.disableXvfb ?? true,
|
|
540
497
|
// CRITICAL: Must be false by default to allow brave-real-browser to modify flags
|
|
541
498
|
ignoreAllFlags: options?.ignoreAllFlags ?? false,
|
|
542
499
|
args: [],
|
|
@@ -546,13 +503,8 @@ export async function initializeBrowser(options) {
|
|
|
546
503
|
...(options?.connectOption ?? {}),
|
|
547
504
|
},
|
|
548
505
|
};
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
if (proxyUrl) {
|
|
552
|
-
if (!connectOptions.customConfig.chromeFlags) {
|
|
553
|
-
connectOptions.customConfig.chromeFlags = [];
|
|
554
|
-
}
|
|
555
|
-
connectOptions.customConfig.chromeFlags.push(`--proxy-server=${proxyUrl}`);
|
|
506
|
+
if (options?.proxy) {
|
|
507
|
+
connectOptions.customConfig.chromeFlags.push(`--proxy-server=${options.proxy}`);
|
|
556
508
|
}
|
|
557
509
|
// Explicitly enforce headless mode via flags if enabled
|
|
558
510
|
// This fixes issues where brave-real-browser might default to GUI
|
|
@@ -597,13 +549,13 @@ export async function initializeBrowser(options) {
|
|
|
597
549
|
strategyName: 'User-Defined Configuration',
|
|
598
550
|
strategy: {
|
|
599
551
|
executablePath: detectedBravePath,
|
|
600
|
-
headless:
|
|
552
|
+
headless: options?.headless ?? (process.env.HEADLESS === 'true'),
|
|
601
553
|
turnstile: true,
|
|
602
554
|
args: [
|
|
603
555
|
"--start-maximized",
|
|
604
556
|
...uBlockArgs // Add uBlock args to primary strategy
|
|
605
557
|
],
|
|
606
|
-
disableXvfb:
|
|
558
|
+
disableXvfb: true,
|
|
607
559
|
// CRITICAL: Must be false to allow brave-real-browser to process DEFAULT_FLAGS
|
|
608
560
|
ignoreAllFlags: false,
|
|
609
561
|
customConfig: braveConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brave-real-browser-mcp-server",
|
|
3
|
-
"version": "2.18.
|
|
3
|
+
"version": "2.18.5",
|
|
4
4
|
"description": "Universal AI IDE MCP Server - Auto-detects and supports all AI IDEs (Claude Desktop, Cursor, Windsurf, Cline, Zed, VSCode, Qoder AI, etc.) with Brave browser automation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/turndown": "^5.0.6",
|
|
39
39
|
"ajv": "^8.17.1",
|
|
40
40
|
"axios": "^1.13.2",
|
|
41
|
-
"brave-real-browser": "^1.5.
|
|
41
|
+
"brave-real-browser": "^1.5.106",
|
|
42
42
|
"brave-real-launcher": "^1.2.32",
|
|
43
43
|
"brave-real-puppeteer-core": "^24.34.0",
|
|
44
44
|
"compromise": "^14.14.5",
|