mcp-web-inspector 0.9.2 → 0.9.4
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/toolHandler.js +20 -6
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -927,7 +927,7 @@ Navigate to a URL. Browser sessions (cookies, localStorage, sessionStorage) are
|
|
|
927
927
|
- height (number, optional): Viewport height in pixels. If not specified, automatically matches screen height. Ignored if device is specified.
|
|
928
928
|
- timeout (number, optional): Navigation timeout in milliseconds
|
|
929
929
|
- waitUntil (string, optional): Navigation wait condition
|
|
930
|
-
- headless (boolean, optional): Run browser in headless mode (default:
|
|
930
|
+
- headless (boolean, optional): Run browser in headless mode (default: true - no window shown)
|
|
931
931
|
|
|
932
932
|
#### `scroll_by`
|
|
933
933
|
Scroll a container (or page) by a specific number of pixels. Auto-detects scroll direction when only one is available. Essential for: testing sticky headers/footers, triggering infinite scroll, carousel navigation, precise scroll position testing. Use 'html' or 'body' for page scrolling. Positive pixels = down/right, negative = up/left. Outputs: ✓ success summary with axis position and percent of max scroll; ⚠️ boundary notice when movement is limited; ⚠️ ambiguous-direction guidance when both axes scroll; ⚠️ not-scrollable report with ancestor suggestions; 💡 follow-up tips matching the detected scenario.
|
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ const sessionConfig = {
|
|
|
54
54
|
saveSession: !Boolean(values['no-save-session']),
|
|
55
55
|
userDataDir: `${baseDir}/user-data`,
|
|
56
56
|
screenshotsDir: `${baseDir}/screenshots`,
|
|
57
|
-
headlessDefault: Boolean(values['headless']),
|
|
57
|
+
headlessDefault: Boolean(values['headless']) || (process.platform === 'linux' && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY),
|
|
58
58
|
exposeSensitiveNetworkData: Boolean(values['expose-sensitive-network-data']),
|
|
59
59
|
};
|
|
60
60
|
setSessionConfig(sessionConfig);
|
package/dist/toolHandler.js
CHANGED
|
@@ -396,10 +396,14 @@ export async function ensureBrowser(browserSettings) {
|
|
|
396
396
|
console.error(`No viewport specified, using screen size: ${viewportWidth}x${viewportHeight}`);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
+
// LocalNetworkAccessChecks: Chrome blocks fetch/XHR from public origins to private/CGNAT
|
|
400
|
+
// IPs (e.g. Tailscale 100.64.0.0/10). This breaks environments where the API is on an
|
|
401
|
+
// internal network but the app is served from a public CDN.
|
|
399
402
|
// Prepare context options
|
|
400
403
|
const contextOptions = {
|
|
401
404
|
headless,
|
|
402
405
|
executablePath: executablePath,
|
|
406
|
+
args: ['--disable-features=LocalNetworkAccessChecks'],
|
|
403
407
|
};
|
|
404
408
|
// If device config exists, use it; otherwise use manual viewport/userAgent
|
|
405
409
|
if (deviceConfig) {
|
|
@@ -528,13 +532,22 @@ export async function ensureBrowser(browserSettings) {
|
|
|
528
532
|
const { join } = await import('node:path');
|
|
529
533
|
try {
|
|
530
534
|
const dirs = readdirSync(installPath);
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
535
|
+
// Sort descending to prefer the newest chromium revision
|
|
536
|
+
const chromiumDirs = dirs
|
|
537
|
+
.filter(d => d.startsWith('chromium-') && !d.includes('headless'))
|
|
538
|
+
.sort().reverse();
|
|
539
|
+
for (const chromiumDir of chromiumDirs) {
|
|
540
|
+
// Newer Playwright uses chrome-linux64/, older uses chrome-linux/
|
|
541
|
+
for (const subdir of ['chrome-linux64', 'chrome-linux']) {
|
|
542
|
+
const chromePath = join(installPath, chromiumDir, subdir, 'chrome');
|
|
543
|
+
if (existsSync(chromePath)) {
|
|
544
|
+
process.env.CHROME_EXECUTABLE_PATH = chromePath;
|
|
545
|
+
console.error(`Chromium installed at ${chromePath}`);
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
537
548
|
}
|
|
549
|
+
if (process.env.CHROME_EXECUTABLE_PATH)
|
|
550
|
+
break;
|
|
538
551
|
}
|
|
539
552
|
}
|
|
540
553
|
catch {
|
|
@@ -598,6 +611,7 @@ export async function ensureBrowser(browserSettings) {
|
|
|
598
611
|
const retryContextOptions = {
|
|
599
612
|
headless,
|
|
600
613
|
executablePath: executablePath,
|
|
614
|
+
args: ['--disable-features=LocalNetworkAccessChecks'],
|
|
601
615
|
};
|
|
602
616
|
// If device config exists, use it; otherwise use manual viewport/userAgent
|
|
603
617
|
if (deviceConfig) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-web-inspector",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "Web Inspector MCP: Give LLMs visual superpowers to see, debug, and test any web page.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Anton",
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "1.21.0",
|
|
32
|
-
"@playwright/browser-chromium": "1.
|
|
33
|
-
"playwright": "1.
|
|
32
|
+
"@playwright/browser-chromium": "1.58.2",
|
|
33
|
+
"playwright": "1.58.2",
|
|
34
|
+
"playwright-core": "1.58.2",
|
|
34
35
|
"uuid": "13.0.0"
|
|
35
36
|
},
|
|
36
37
|
"keywords": [
|