Bug 24194
Summary: | XHR body empty in inspector | ||
---|---|---|---|
Product: | WebKit | Reporter: | Rene van Lieshout <rene> |
Component: | Web Inspector (Deprecated) | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | aroben, kmccullough, rene, rik, timothy |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://rene.lico.nl/safari.php |
Rene van Lieshout
When a resource is clicked _before_ it finished loading, the body stays empty.
Steps to reproduce bug
- Open example script (source below): http://rene.lico.nl/safari.php
- Open inspector
- Click "Resources"
- Click last resource "safari.php"e; (resource should be loading while you click on it)
- Wait for the resource to load ("Response headers" appear)
- The body is empty
- Wait for another resource to load
- Click the loaded resource (note: this should not be the resource you've clicked at step 3)
- The body contains "-- test --"
Comments
- If you don't wait for a resource to complete before you open it in the inspector, the body stays empty.
- The body should contain "-- test --"
- The XHR is delayed by 5 seconds and looped until infinity.
- Only tested in "Version 4 Public Beta (5528.16)" and "Version 4 Public Beta (5528.16, r41242) on "Mac OS X 10.5.6, intel c2d 2 ghz"
Source
<?
if (array_key_exists("test",$_GET)) {
sleep(5);
die("-- test --");
}
?>
<html>
<head>
<title>Webkit XHR test</title>
<script type="text/javascript" charset="utf-8">
function init_test () {
loadXMLDoc()
}
var req;
function loadXMLDoc() {
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.open("GET", '<?=$_SERVER["PHP_SELF"]?>?test=1', true);
req.send("");
}
function processReqChange() {
if (req.readyState == 4 && req.status == 200) {
loadXMLDoc();
}
}
</script>
</head>
<body onload="init_test();">
<h1>Bug: XHR request empty in inspector</h1>
<h2>Steps to reproduce bug</h2>
<ol>
<li>Open inspector</li>
<li>Click "Resources"</li>
<li>Click last resource "safari.php"e; (resource should be loading while you click on it)</li>
<li>Wait for the resource to load ("Response headers" appear)</li>
<li style="color: red;">The body is empty</li>
<li>Wait for another resource to load</li>
<li>Click the loaded resource (note: this should not be the resource you've clicked at step 3)</li>
<li style="color: green;">The body contains "-- test --"</li>
</ol>
<h2>Comments</h2>
<ul>
<li>If you don't wait for a resource to complete before you open it in the inspector, the body stays empty.</li>
<li>The body should contain "-- test --"</li>
<li>The XHR is delayed by 5 seconds and looped until infinity.</li>
</ul>
</body>
</html>
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Anthony Ricaud
Confirmed with r41242
Rene van Lieshout
This bug seems resolved in at least Safari version 5.0 (6533.16)
The only issue remaining is that when the XHR is loaded, the tab headers disappears and the content is replaced by the response of the request. There should be two tabs visible: headers and content.
Alexey Proskuryakov
> The only issue remaining
Could you please file a new bug about that?