@yezack/chrome-devtools-mcp-108 1.10.2 → 1.10.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/FORK-NOTICE.md +28 -2
- package/README.md +9 -2
- package/build/src/utils/check-for-updates.js +15 -2
- package/build/src/version.js +1 -1
- package/package.json +1 -1
package/FORK-NOTICE.md
CHANGED
|
@@ -12,8 +12,11 @@ team. For the official package use `chrome-devtools-mcp`.
|
|
|
12
12
|
Base: upstream tag `chrome-devtools-mcp-v1.10.1` (puppeteer-core 25.11.0),
|
|
13
13
|
taken from the published npm tarball.
|
|
14
14
|
|
|
15
|
-
Modified
|
|
16
|
-
appended to the same module).
|
|
15
|
+
Modified files: `build/src/third_party/index.js` (one code path, plus one
|
|
16
|
+
helper appended to the same module), `build/src/BrowserManager.js` and
|
|
17
|
+
`build/src/utils/check-for-updates.js`.
|
|
18
|
+
|
|
19
|
+
### 1. Page discovery on Chrome 108-110
|
|
17
20
|
|
|
18
21
|
Upstream initialises target discovery with:
|
|
19
22
|
|
|
@@ -36,6 +39,29 @@ This fork wraps that one call site in
|
|
|
36
39
|
111, removes `filter`. Those browsers then attach page targets directly, which
|
|
37
40
|
puppeteer handles correctly. Browsers 111 and newer are passed through unchanged.
|
|
38
41
|
|
|
42
|
+
### 2. Temporary profile by default
|
|
43
|
+
|
|
44
|
+
Upstream launches with a persistent user-data-dir at
|
|
45
|
+
`$HOME/.cache/chrome-devtools-mcp/chrome-profile` and creates it with `mkdir`
|
|
46
|
+
before launching. On a host where the home directory is a read-only mount that
|
|
47
|
+
fails with `EROFS`/`EPERM`, and the failure surfaces through every page tool
|
|
48
|
+
(`list_pages` returned that mkdir error). This fork defaults to an isolated
|
|
49
|
+
temporary profile instead (under the OS temp directory, e.g. `$TMPDIR` on
|
|
50
|
+
Linux), which is what the upstream CLI entry point already did. The default is
|
|
51
|
+
applied as a destructuring default rather than a yargs default, so
|
|
52
|
+
`--user-data-dir <path>` still wins the conflict resolution. `--no-isolated`
|
|
53
|
+
restores the upstream behaviour.
|
|
54
|
+
|
|
55
|
+
### 3. Update-check cache location
|
|
56
|
+
|
|
57
|
+
The update check cached the latest version in a hardcoded
|
|
58
|
+
`$HOME/.cache/chrome-devtools-mcp/latest.json` (20 bytes), independent of the
|
|
59
|
+
profile setting, so a read-only home still received a write attempt on every
|
|
60
|
+
start. It now picks the first writable directory out of
|
|
61
|
+
`$HOME/.cache/chrome-devtools-mcp` and `$TMPDIR/chrome-devtools-mcp`: normal
|
|
62
|
+
hosts keep the upstream location, read-only homes fall back to the OS temp
|
|
63
|
+
directory. `CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1` skips the check entirely.
|
|
64
|
+
|
|
39
65
|
Verified against Chromium 108.0.5351.0 (snapshot r1056772) and
|
|
40
66
|
Chrome 154.0.8037.99.
|
|
41
67
|
|
package/README.md
CHANGED
|
@@ -6,8 +6,15 @@ that also works against **Chrome/Chromium 108-110**.
|
|
|
6
6
|
The upstream package requires Chrome 111+ for page discovery: on Chrome 108 the
|
|
7
7
|
connection-level `Target.setAutoAttach` filter suppresses every target, so
|
|
8
8
|
`list_pages` returns an empty array. This fork removes that filter on browsers
|
|
9
|
-
older than 111
|
|
10
|
-
|
|
9
|
+
older than 111.
|
|
10
|
+
|
|
11
|
+
It also defaults to an isolated temporary profile under the OS temp directory
|
|
12
|
+
instead of `$HOME/.cache/chrome-devtools-mcp`, so it starts on hosts whose home
|
|
13
|
+
directory is a read-only mount. Pass `--no-isolated` for the persistent
|
|
14
|
+
upstream profile, or `--user-data-dir <path>` to choose a specific one.
|
|
15
|
+
|
|
16
|
+
Otherwise this fork is identical to upstream 1.10.1. See
|
|
17
|
+
[FORK-NOTICE.md](./FORK-NOTICE.md) for the exact changes and the evidence.
|
|
11
18
|
|
|
12
19
|
## Usage
|
|
13
20
|
|
|
@@ -24,7 +24,7 @@ export async function checkForUpdates(message) {
|
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
isChecking = true;
|
|
27
|
-
const cachePath = path.join(os.homedir(), '.cache', 'chrome-devtools-mcp', 'latest.json');
|
|
27
|
+
const cachePath = path.join(await __dshWritableDir([path.join(os.homedir(), '.cache', 'chrome-devtools-mcp'), path.join(os.tmpdir(), 'chrome-devtools-mcp')]), 'latest.json');
|
|
28
28
|
let cachedVersion;
|
|
29
29
|
let stats;
|
|
30
30
|
try {
|
|
@@ -72,4 +72,17 @@ export async function checkForUpdates(message) {
|
|
|
72
72
|
// Fail silently in case of any errors.
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
//# sourceMappingURL=check-for-updates.js.map
|
|
75
|
+
//# sourceMappingURL=check-for-updates.js.map
|
|
76
|
+
|
|
77
|
+
async function __dshWritableDir(candidates) {
|
|
78
|
+
for (const dir of candidates) {
|
|
79
|
+
try {
|
|
80
|
+
await fs.mkdir(dir, {recursive: true});
|
|
81
|
+
return dir;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Not writable (for example a read-only home directory).
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return candidates[candidates.length - 1];
|
|
88
|
+
}
|
package/build/src/version.js
CHANGED
package/package.json
CHANGED