mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00

feat(trace viewer): Extending existing NetworkTab view Currently the network tab contains a limited amount of information on the resources that were loaded in the browser. This change proposes extending the details displayed for each resource, to include: - HTTP method, - Full url, - Easily visible response content type, - Request headers, - Request & response bodies. Such level of information could help quickly understand what happened in the application, when it was communicating with backend services. This can help debug tests quicker to figure out why they are failing. This implementation still needs some clean up & tests improvement, but I wanted to propose such changes and gather your feedback before going too far.
19 lines
644 B
HTML
19 lines
644 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Tracer XHR Network Resource example</title>
|
|
</head>
|
|
<body>
|
|
<div id="response-status"></div>
|
|
<div id="response-body"></div>
|
|
<script>
|
|
async function performXHR() {
|
|
const response = await window.fetch('./file.json', {method: 'POST', body: JSON.stringify({prop: 'value'})});
|
|
document.querySelector('#response-status').innerText = response.status;
|
|
const responseText = await response.text();
|
|
document.querySelector('#response-body').innerText = responseText;
|
|
}
|
|
</script>
|
|
<a onclick="javascipt:performXHR();">Download</a>
|
|
</body>
|
|
</html> |