Skip to content

Commit 55bc747

Browse files
committed
chore: docs fixes
1 parent dadff6b commit 55bc747

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/recipes/network.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ rrweb.record({
4444
initiatorTypes: ['fetch', 'xmlhttprequest'],
4545
// mask/block recording event for request
4646
transformRequestFn: (request) => {
47-
if (request.url.contains('rrweb-collector-api.com')) return; // skip request
47+
// request.name is url
48+
if (request.name.contains('rrweb-collector-api.com')) return; // skip request
4849
delete request.requestHeaders['Authorization']; // remove sensetive data
4950
request.responseBody = maskTextFn(request.responseBody);
5051
return request;
@@ -82,10 +83,10 @@ const replayer = new rrweb.Replayer(events, {
8283
getReplayNetworkPlugin({
8384
onNetworkData: ({ requests }) => {
8485
for (const request of requests) {
85-
const url = request.url;
86+
const name = request.name; // url
8687
const method = request.method;
8788
const status = request.status;
88-
console.log(`${method} ${url} ${status}`);
89+
console.log(`${method} ${name} ${status}`);
8990
}
9091
},
9192
}),

0 commit comments

Comments
 (0)