Select a request from the list to inspect details or fulfill live breakpoints.
| Active | Method | URL Pattern | Status | Delay | Actions |
|---|
Mucker implements the core semantic Fetch Domain of CDP. Any automated test tool (Puppeteer, Playwright, Python, or curl) can connect via WebSocket to mock or inspect network requests.
import WebSocket from 'ws';
const ws = new WebSocket('ws://localhost:8080/devtools/page');
ws.on('open', () => {
// Enable CDP Fetch domain interception
ws.send(JSON.stringify({
id: 1,
method: 'Fetch.enable',
params: { patterns: [{ urlPattern: '*' }] }
}));
});
ws.on('message', (raw) => {
const msg = JSON.parse(raw);
if (msg.method === 'Fetch.requestPaused') {
const { requestId, request } = msg.params;
console.log('Paused request:', request.url);
// Mock API response via Fetch.fulfillRequest
ws.send(JSON.stringify({
id: 2,
method: 'Fetch.fulfillRequest',
params: {
requestId,
responseCode: 200,
responseHeaders: [{ name: 'Content-Type', value: 'application/json' }],
body: Buffer.from(JSON.stringify({ user: 'Injected Hero' })).toString('base64')
}
}));
}
});