/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
lib/internal/inspector/network_resources.js
27 строк
820 B
Shima Ryuhei
inspector: initial support for Network.loadNetworkResource
10 июл 2025, 15:34
Не верифицирован
10 июл 2025, 15:34
b7db89f
Код
Авторство
О чём код?
'use strict'; const { getOptionValue } = require('internal/options'); const { validateString } = require('internal/validators'); const { putNetworkResource } = internalBinding('inspector'); /** * Registers a resource for the inspector using the internal 'putNetworkResource' binding. * @param {string} url - The URL of the resource. * @param {string} data - The content of the resource to provide. */ function put(url, data) { if (!getOptionValue('--experimental-inspector-network-resource')) { process.emitWarning( 'The --experimental-inspector-network-resource option is not enabled. ' + 'Please enable it to use the putNetworkResource function'); return; } validateString(url, 'url'); validateString(data, 'data'); putNetworkResource(url, data); } module.exports = { put, };