chrome-devtools-mcp 0.24.0 → 0.25.0
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 +22 -5
- package/build/src/McpPage.js +4 -4
- package/build/src/McpResponse.js +18 -16
- package/build/src/TextSnapshot.js +2 -2
- package/build/src/bin/chrome-devtools-cli-options.js +27 -4
- package/build/src/bin/chrome-devtools-mcp-cli-options.js +8 -5
- package/build/src/bin/chrome-devtools-mcp-main.js +0 -5
- package/build/src/third_party/THIRD_PARTY_NOTICES +3 -3
- package/build/src/third_party/bundled-packages.json +2 -2
- package/build/src/third_party/devtools-formatter-worker.js +18 -0
- package/build/src/third_party/devtools-heap-snapshot-worker.js +18 -0
- package/build/src/third_party/index.js +578 -278
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/build/src/tools/categories.js +6 -3
- package/build/src/tools/input.js +44 -0
- package/build/src/tools/pages.js +5 -5
- package/build/src/tools/{inPage.js → thirdPartyDeveloper.js} +15 -15
- package/build/src/tools/tools.js +2 -2
- package/build/src/tools/webmcp.js +2 -4
- package/build/src/version.js +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -477,7 +477,7 @@ If you run into any issues, checkout our [troubleshooting guide](./docs/troubles
|
|
|
477
477
|
|
|
478
478
|
<!-- BEGIN AUTO GENERATED TOOLS -->
|
|
479
479
|
|
|
480
|
-
- **Input automation** (
|
|
480
|
+
- **Input automation** (10 tools)
|
|
481
481
|
- [`click`](docs/tool-reference.md#click)
|
|
482
482
|
- [`drag`](docs/tool-reference.md#drag)
|
|
483
483
|
- [`fill`](docs/tool-reference.md#fill)
|
|
@@ -487,6 +487,7 @@ If you run into any issues, checkout our [troubleshooting guide](./docs/troubles
|
|
|
487
487
|
- [`press_key`](docs/tool-reference.md#press_key)
|
|
488
488
|
- [`type_text`](docs/tool-reference.md#type_text)
|
|
489
489
|
- [`upload_file`](docs/tool-reference.md#upload_file)
|
|
490
|
+
- [`click_at`](docs/tool-reference.md#click_at)
|
|
490
491
|
- **Navigation automation** (6 tools)
|
|
491
492
|
- [`close_page`](docs/tool-reference.md#close_page)
|
|
492
493
|
- [`list_pages`](docs/tool-reference.md#list_pages)
|
|
@@ -504,21 +505,32 @@ If you run into any issues, checkout our [troubleshooting guide](./docs/troubles
|
|
|
504
505
|
- **Network** (2 tools)
|
|
505
506
|
- [`get_network_request`](docs/tool-reference.md#get_network_request)
|
|
506
507
|
- [`list_network_requests`](docs/tool-reference.md#list_network_requests)
|
|
507
|
-
- **Debugging** (
|
|
508
|
+
- **Debugging** (8 tools)
|
|
508
509
|
- [`evaluate_script`](docs/tool-reference.md#evaluate_script)
|
|
509
510
|
- [`get_console_message`](docs/tool-reference.md#get_console_message)
|
|
510
511
|
- [`lighthouse_audit`](docs/tool-reference.md#lighthouse_audit)
|
|
511
512
|
- [`list_console_messages`](docs/tool-reference.md#list_console_messages)
|
|
512
513
|
- [`take_screenshot`](docs/tool-reference.md#take_screenshot)
|
|
513
514
|
- [`take_snapshot`](docs/tool-reference.md#take_snapshot)
|
|
515
|
+
- [`screencast_start`](docs/tool-reference.md#screencast_start)
|
|
516
|
+
- [`screencast_stop`](docs/tool-reference.md#screencast_stop)
|
|
517
|
+
- **Memory** (4 tools)
|
|
518
|
+
- [`take_memory_snapshot`](docs/tool-reference.md#take_memory_snapshot)
|
|
519
|
+
- [`get_memory_snapshot_details`](docs/tool-reference.md#get_memory_snapshot_details)
|
|
520
|
+
- [`get_nodes_by_class`](docs/tool-reference.md#get_nodes_by_class)
|
|
521
|
+
- [`load_memory_snapshot`](docs/tool-reference.md#load_memory_snapshot)
|
|
514
522
|
- **Extensions** (5 tools)
|
|
515
523
|
- [`install_extension`](docs/tool-reference.md#install_extension)
|
|
516
524
|
- [`list_extensions`](docs/tool-reference.md#list_extensions)
|
|
517
525
|
- [`reload_extension`](docs/tool-reference.md#reload_extension)
|
|
518
526
|
- [`trigger_extension_action`](docs/tool-reference.md#trigger_extension_action)
|
|
519
527
|
- [`uninstall_extension`](docs/tool-reference.md#uninstall_extension)
|
|
520
|
-
- **
|
|
521
|
-
- [`
|
|
528
|
+
- **Third-party** (2 tools)
|
|
529
|
+
- [`execute_3p_developer_tool`](docs/tool-reference.md#execute_3p_developer_tool)
|
|
530
|
+
- [`list_3p_developer_tools`](docs/tool-reference.md#list_3p_developer_tools)
|
|
531
|
+
- **WebMCP** (2 tools)
|
|
532
|
+
- [`execute_webmcp_tool`](docs/tool-reference.md#execute_webmcp_tool)
|
|
533
|
+
- [`list_webmcp_tools`](docs/tool-reference.md#list_webmcp_tools)
|
|
522
534
|
|
|
523
535
|
<!-- END AUTO GENERATED TOOLS -->
|
|
524
536
|
|
|
@@ -595,7 +607,7 @@ The Chrome DevTools MCP server supports the following configuration option:
|
|
|
595
607
|
Path to ffmpeg executable for screencast recording.
|
|
596
608
|
- **Type:** string
|
|
597
609
|
|
|
598
|
-
- **`--
|
|
610
|
+
- **`--categoryExperimentalWebmcp`/ `--category-experimental-webmcp`**
|
|
599
611
|
Set to true to enable debugging WebMCP tools. Requires Chrome 149+ with the following flags: `--enable-features=WebMCPTesting,DevToolsWebMCPSupport`
|
|
600
612
|
- **Type:** boolean
|
|
601
613
|
|
|
@@ -627,6 +639,11 @@ The Chrome DevTools MCP server supports the following configuration option:
|
|
|
627
639
|
- **Type:** boolean
|
|
628
640
|
- **Default:** `false`
|
|
629
641
|
|
|
642
|
+
- **`--categoryExperimentalThirdParty`/ `--category-experimental-third-party`**
|
|
643
|
+
Set to true to enable third-party developer tools exposed by the inspected page itself
|
|
644
|
+
- **Type:** boolean
|
|
645
|
+
- **Default:** `false`
|
|
646
|
+
|
|
630
647
|
- **`--performanceCrux`/ `--performance-crux`**
|
|
631
648
|
Set to false to disable sending URLs from performance traces to CrUX API to get field performance data.
|
|
632
649
|
- **Type:** boolean
|
package/build/src/McpPage.js
CHANGED
|
@@ -30,7 +30,7 @@ export class McpPage {
|
|
|
30
30
|
// Dialog
|
|
31
31
|
#dialog;
|
|
32
32
|
#dialogHandler;
|
|
33
|
-
|
|
33
|
+
thirdPartyDeveloperTools;
|
|
34
34
|
constructor(page, id) {
|
|
35
35
|
this.pptrPage = page;
|
|
36
36
|
this.id = id;
|
|
@@ -53,8 +53,8 @@ export class McpPage {
|
|
|
53
53
|
throw new Error(`A dialog is open (${this.#dialog.type()}: ${this.#dialog.message()}).`);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
return this.
|
|
56
|
+
getThirdPartyDeveloperTools() {
|
|
57
|
+
return this.thirdPartyDeveloperTools;
|
|
58
58
|
}
|
|
59
59
|
getWebMcpTools() {
|
|
60
60
|
return this.pptrPage.webmcp.tools();
|
|
@@ -88,7 +88,7 @@ export class McpPage {
|
|
|
88
88
|
dispose() {
|
|
89
89
|
this.pptrPage.off('dialog', this.#dialogHandler);
|
|
90
90
|
}
|
|
91
|
-
async
|
|
91
|
+
async executeThirdPartyDeveloperTool(toolName, params, response) {
|
|
92
92
|
// Creates array of ElementHandles from the UIDs in the params.
|
|
93
93
|
// We do not replace the uids with the ElementsHandles yet, because
|
|
94
94
|
// the `evaluate` function only turns them into DOM elements if they
|
package/build/src/McpResponse.js
CHANGED
|
@@ -125,7 +125,7 @@ export class McpResponse {
|
|
|
125
125
|
#networkRequestsOptions;
|
|
126
126
|
#consoleDataOptions;
|
|
127
127
|
#listExtensions;
|
|
128
|
-
#
|
|
128
|
+
#listThirdPartyDeveloperTools;
|
|
129
129
|
#listWebMcpTools;
|
|
130
130
|
#devToolsData;
|
|
131
131
|
#tabId;
|
|
@@ -163,9 +163,9 @@ export class McpResponse {
|
|
|
163
163
|
setListExtensions() {
|
|
164
164
|
this.#listExtensions = true;
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
if (this.#args.
|
|
168
|
-
this.#
|
|
166
|
+
setListThirdPartyDeveloperTools() {
|
|
167
|
+
if (this.#args.categoryExperimentalThirdParty) {
|
|
168
|
+
this.#listThirdPartyDeveloperTools = true;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
setListWebMcpTools() {
|
|
@@ -381,14 +381,14 @@ export class McpResponse {
|
|
|
381
381
|
if (this.#listExtensions) {
|
|
382
382
|
extensions = await context.listExtensions();
|
|
383
383
|
}
|
|
384
|
-
let
|
|
385
|
-
if (this.#
|
|
384
|
+
let thirdPartyDeveloperTools;
|
|
385
|
+
if (this.#listThirdPartyDeveloperTools) {
|
|
386
386
|
const page = this.#page ?? context.getSelectedMcpPage();
|
|
387
|
-
|
|
388
|
-
page.
|
|
387
|
+
thirdPartyDeveloperTools = await getToolGroup(page);
|
|
388
|
+
page.thirdPartyDeveloperTools = thirdPartyDeveloperTools;
|
|
389
389
|
}
|
|
390
390
|
let webmcpTools;
|
|
391
|
-
if (this.#listWebMcpTools && this.#args.
|
|
391
|
+
if (this.#listWebMcpTools && this.#args.categoryExperimentalWebmcp) {
|
|
392
392
|
const page = this.#page ?? context.getSelectedMcpPage();
|
|
393
393
|
webmcpTools = page.getWebMcpTools();
|
|
394
394
|
}
|
|
@@ -469,7 +469,7 @@ export class McpResponse {
|
|
|
469
469
|
traceSummary: this.#attachedTraceSummary,
|
|
470
470
|
extensions,
|
|
471
471
|
lighthouseResult: this.#attachedLighthouseResult,
|
|
472
|
-
|
|
472
|
+
thirdPartyDeveloperTools,
|
|
473
473
|
webmcpTools,
|
|
474
474
|
errorMessage: this.#error?.message,
|
|
475
475
|
});
|
|
@@ -700,14 +700,16 @@ Call ${handleDialog.name} to handle it before continuing.`);
|
|
|
700
700
|
response.push(extensionsMessage);
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
if (this.#
|
|
704
|
-
structuredContent.
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
703
|
+
if (this.#listThirdPartyDeveloperTools) {
|
|
704
|
+
structuredContent.thirdPartyDeveloperTools =
|
|
705
|
+
data.thirdPartyDeveloperTools ?? undefined;
|
|
706
|
+
response.push('## Third-party developer tools');
|
|
707
|
+
if (!data.thirdPartyDeveloperTools ||
|
|
708
|
+
!data.thirdPartyDeveloperTools.tools) {
|
|
709
|
+
response.push('No third-party developer tools available.');
|
|
708
710
|
}
|
|
709
711
|
else {
|
|
710
|
-
const toolGroup = data.
|
|
712
|
+
const toolGroup = data.thirdPartyDeveloperTools;
|
|
711
713
|
response.push(`${toolGroup.name}: ${toolGroup.description}`);
|
|
712
714
|
response.push('Available tools:');
|
|
713
715
|
const toolDefinitionsMessage = toolGroup.tools
|
|
@@ -99,8 +99,8 @@ export class TextSnapshot {
|
|
|
99
99
|
return snapshot;
|
|
100
100
|
}
|
|
101
101
|
// ExtraHandles represent DOM nodes which might not be part of the accessibility tree, e.g. DOM nodes
|
|
102
|
-
// returned by
|
|
103
|
-
// tree and inserting the node as a child. The ancestor's child nodes are re-parented if necessary.
|
|
102
|
+
// returned by third-party developer tools. We insert them into the tree by finding the closest ancestor
|
|
103
|
+
// in the tree and inserting the node as a child. The ancestor's child nodes are re-parented if necessary.
|
|
104
104
|
static async insertExtraNodes(page, idToNode, seenUniqueIds, snapshotId, idCounter, rootNodeWithId, seenBackendNodeIds, extraHandles) {
|
|
105
105
|
const { uniqueBackendNodeIdToMcpId } = page;
|
|
106
106
|
const createExtraNode = async (handle) => {
|
|
@@ -162,9 +162,27 @@ export const commands = {
|
|
|
162
162
|
},
|
|
163
163
|
},
|
|
164
164
|
},
|
|
165
|
+
execute_3p_developer_tool: {
|
|
166
|
+
description: 'Executes a tool exposed by the page. (requires flag: --categoryExperimentalThirdParty=true)',
|
|
167
|
+
category: 'Third-party',
|
|
168
|
+
args: {
|
|
169
|
+
toolName: {
|
|
170
|
+
name: 'toolName',
|
|
171
|
+
type: 'string',
|
|
172
|
+
description: 'The name of the tool to execute',
|
|
173
|
+
required: true,
|
|
174
|
+
},
|
|
175
|
+
params: {
|
|
176
|
+
name: 'params',
|
|
177
|
+
type: 'string',
|
|
178
|
+
description: 'The JSON-stringified parameters to pass to the tool',
|
|
179
|
+
required: false,
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
165
183
|
execute_webmcp_tool: {
|
|
166
|
-
description: 'Executes a WebMCP tool exposed by the page. (requires flag: --
|
|
167
|
-
category: '
|
|
184
|
+
description: 'Executes a WebMCP tool exposed by the page. (requires flag: --categoryExperimentalWebmcp=true)',
|
|
185
|
+
category: 'WebMCP',
|
|
168
186
|
args: {
|
|
169
187
|
toolName: {
|
|
170
188
|
name: 'toolName',
|
|
@@ -371,6 +389,11 @@ export const commands = {
|
|
|
371
389
|
},
|
|
372
390
|
},
|
|
373
391
|
},
|
|
392
|
+
list_3p_developer_tools: {
|
|
393
|
+
description: "Lists all third-party developer tools the page exposes for providing runtime information.\n Third-party developer tools can be called via the 'execute_3p_developer_tool()' MCP tool.\n Alternatively, third-party developer tools can be executed by calling 'evaluate_script' and adding the\n following command to the script:\n 'window.__dtmcp.executeTool(toolName, params)'\n This might be helpful when the third-party developer tools return non-serializable values or when composing\n third-party developer tools with additional functionality. (requires flag: --categoryExperimentalThirdParty=true)",
|
|
394
|
+
category: 'Third-party',
|
|
395
|
+
args: {},
|
|
396
|
+
},
|
|
374
397
|
list_console_messages: {
|
|
375
398
|
description: 'List all console messages for the currently selected page since the last navigation.',
|
|
376
399
|
category: 'Debugging',
|
|
@@ -444,8 +467,8 @@ export const commands = {
|
|
|
444
467
|
args: {},
|
|
445
468
|
},
|
|
446
469
|
list_webmcp_tools: {
|
|
447
|
-
description: 'Lists all WebMCP tools the page exposes. (requires flag: --
|
|
448
|
-
category: '
|
|
470
|
+
description: 'Lists all WebMCP tools the page exposes. (requires flag: --categoryExperimentalWebmcp=true)',
|
|
471
|
+
category: 'WebMCP',
|
|
449
472
|
args: {},
|
|
450
473
|
},
|
|
451
474
|
load_memory_snapshot: {
|
|
@@ -183,7 +183,7 @@ export const cliOptions = {
|
|
|
183
183
|
describe: 'Path to ffmpeg executable for screencast recording.',
|
|
184
184
|
implies: 'experimentalScreencast',
|
|
185
185
|
},
|
|
186
|
-
|
|
186
|
+
categoryExperimentalWebmcp: {
|
|
187
187
|
type: 'boolean',
|
|
188
188
|
describe: 'Set to true to enable debugging WebMCP tools. Requires Chrome 149+ with the following flags: `--enable-features=WebMCPTesting,DevToolsWebMCPSupport`',
|
|
189
189
|
},
|
|
@@ -216,11 +216,10 @@ export const cliOptions = {
|
|
|
216
216
|
default: false,
|
|
217
217
|
describe: 'Set to true to include tools related to extensions. Note: This feature is currently only supported with a pipe connection. autoConnect, browserUrl, and wsEndpoint are not supported with this feature until 149 will be released.',
|
|
218
218
|
},
|
|
219
|
-
|
|
219
|
+
categoryExperimentalThirdParty: {
|
|
220
220
|
type: 'boolean',
|
|
221
|
-
hidden: true,
|
|
222
221
|
default: false,
|
|
223
|
-
describe: 'Set to true to enable tools exposed by the inspected page itself',
|
|
222
|
+
describe: 'Set to true to enable third-party developer tools exposed by the inspected page itself',
|
|
224
223
|
},
|
|
225
224
|
performanceCrux: {
|
|
226
225
|
type: 'boolean',
|
|
@@ -262,7 +261,7 @@ export const cliOptions = {
|
|
|
262
261
|
default: false,
|
|
263
262
|
},
|
|
264
263
|
};
|
|
265
|
-
export function parseArguments(version, argv = process.argv) {
|
|
264
|
+
export function parseArguments(version, argv = process.argv, env = process.env) {
|
|
266
265
|
const yargsInstance = yargs(hideBin(argv))
|
|
267
266
|
.scriptName('npx chrome-devtools-mcp@latest')
|
|
268
267
|
.options(cliOptions)
|
|
@@ -275,6 +274,10 @@ export function parseArguments(version, argv = process.argv) {
|
|
|
275
274
|
!args.executablePath) {
|
|
276
275
|
args.channel = 'stable';
|
|
277
276
|
}
|
|
277
|
+
if (env['CI'] || env['CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS']) {
|
|
278
|
+
console.error("turning off usage statistics. process.env['CI'] || process.env['CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS'] is set.");
|
|
279
|
+
args.usageStatistics = false;
|
|
280
|
+
}
|
|
278
281
|
return true;
|
|
279
282
|
})
|
|
280
283
|
.example([
|
|
@@ -15,11 +15,6 @@ import { cliOptions, parseArguments } from './chrome-devtools-mcp-cli-options.js
|
|
|
15
15
|
await checkForUpdates('Run `npm install chrome-devtools-mcp@latest` to update.');
|
|
16
16
|
export const args = parseArguments(VERSION);
|
|
17
17
|
const logFile = args.logFile ? saveLogsToFile(args.logFile) : undefined;
|
|
18
|
-
if (process.env['CI'] ||
|
|
19
|
-
process.env['CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS']) {
|
|
20
|
-
console.error("turning off usage statistics. process.env['CI'] || process.env['CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS'] is set.");
|
|
21
|
-
args.usageStatistics = false;
|
|
22
|
-
}
|
|
23
18
|
if (process.env['CHROME_DEVTOOLS_MCP_CRASH_ON_UNCAUGHT'] !== 'true') {
|
|
24
19
|
process.on('unhandledRejection', (reason, promise) => {
|
|
25
20
|
logger('Unhandled promise rejection', promise, reason);
|
|
@@ -869,14 +869,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
869
869
|
|
|
870
870
|
Name: puppeteer-core
|
|
871
871
|
URL: https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer-core
|
|
872
|
-
Version: 24.
|
|
872
|
+
Version: 24.43.0
|
|
873
873
|
License: Apache-2.0
|
|
874
874
|
|
|
875
875
|
-------------------- DEPENDENCY DIVIDER --------------------
|
|
876
876
|
|
|
877
877
|
Name: @puppeteer/browsers
|
|
878
878
|
URL: https://github.com/puppeteer/puppeteer/tree/main/packages/browsers
|
|
879
|
-
Version: 2.13.
|
|
879
|
+
Version: 2.13.1
|
|
880
880
|
License: Apache-2.0
|
|
881
881
|
|
|
882
882
|
-------------------- DEPENDENCY DIVIDER --------------------
|
|
@@ -1598,7 +1598,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
1598
1598
|
|
|
1599
1599
|
Name: ws
|
|
1600
1600
|
URL: https://github.com/websockets/ws
|
|
1601
|
-
Version: 8.
|
|
1601
|
+
Version: 8.20.0
|
|
1602
1602
|
License: MIT
|
|
1603
1603
|
|
|
1604
1604
|
Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
3
|
-
"chrome-devtools-frontend": "1.0.
|
|
3
|
+
"chrome-devtools-frontend": "1.0.1625079",
|
|
4
4
|
"core-js": "3.49.0",
|
|
5
5
|
"debug": "4.4.3",
|
|
6
6
|
"lighthouse": "13.2.0",
|
|
7
7
|
"semver": "^7.7.4",
|
|
8
8
|
"urlpattern-polyfill": "^10.1.0",
|
|
9
9
|
"yargs": "18.0.0",
|
|
10
|
-
"puppeteer-core": "24.
|
|
10
|
+
"puppeteer-core": "24.43.0"
|
|
11
11
|
}
|
|
@@ -85,6 +85,15 @@ const HOST_RUNTIME$2 = {
|
|
|
85
85
|
return new WebWorker(url);
|
|
86
86
|
},
|
|
87
87
|
workerScope: new WebWorkerScope(),
|
|
88
|
+
getOnLine() {
|
|
89
|
+
return navigator.onLine;
|
|
90
|
+
},
|
|
91
|
+
getUserAgent() {
|
|
92
|
+
return navigator.userAgent;
|
|
93
|
+
},
|
|
94
|
+
getLocalStorage() {
|
|
95
|
+
return 'localStorage' in globalThis ? globalThis.localStorage : undefined;
|
|
96
|
+
},
|
|
88
97
|
};
|
|
89
98
|
|
|
90
99
|
var HostRuntime$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -167,6 +176,15 @@ const HOST_RUNTIME$1 = {
|
|
|
167
176
|
return new NodeWorker(url);
|
|
168
177
|
},
|
|
169
178
|
workerScope: new NodeWorkerScope(),
|
|
179
|
+
getOnLine() {
|
|
180
|
+
return true;
|
|
181
|
+
},
|
|
182
|
+
getUserAgent() {
|
|
183
|
+
return 'Node.js';
|
|
184
|
+
},
|
|
185
|
+
getLocalStorage() {
|
|
186
|
+
return undefined;
|
|
187
|
+
},
|
|
170
188
|
};
|
|
171
189
|
|
|
172
190
|
var HostRuntime = /*#__PURE__*/Object.freeze({
|
|
@@ -125,6 +125,15 @@ const HOST_RUNTIME$2 = {
|
|
|
125
125
|
return new WebWorker(url);
|
|
126
126
|
},
|
|
127
127
|
workerScope: new WebWorkerScope(),
|
|
128
|
+
getOnLine() {
|
|
129
|
+
return navigator.onLine;
|
|
130
|
+
},
|
|
131
|
+
getUserAgent() {
|
|
132
|
+
return navigator.userAgent;
|
|
133
|
+
},
|
|
134
|
+
getLocalStorage() {
|
|
135
|
+
return 'localStorage' in globalThis ? globalThis.localStorage : undefined;
|
|
136
|
+
},
|
|
128
137
|
};
|
|
129
138
|
|
|
130
139
|
var HostRuntime$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -207,6 +216,15 @@ const HOST_RUNTIME$1 = {
|
|
|
207
216
|
return new NodeWorker(url);
|
|
208
217
|
},
|
|
209
218
|
workerScope: new NodeWorkerScope(),
|
|
219
|
+
getOnLine() {
|
|
220
|
+
return true;
|
|
221
|
+
},
|
|
222
|
+
getUserAgent() {
|
|
223
|
+
return 'Node.js';
|
|
224
|
+
},
|
|
225
|
+
getLocalStorage() {
|
|
226
|
+
return undefined;
|
|
227
|
+
},
|
|
210
228
|
};
|
|
211
229
|
|
|
212
230
|
var HostRuntime = /*#__PURE__*/Object.freeze({
|