initiator incorrect in Network.requestWillBeSent
See original GitHub issueI am accessing the DevTools API (from Java) and seeing different behavior for the initiator field in Network.requestWillBeSent compared to the behavior in the DevTools Front End. I sniffed the DevTools Front End and the initiator is specified properly in the requestWillBeSent event, however the json from the Java websocket is different when used outside of the DevTools Front End. Most of the time the initiator is the same and matches what is in DevTools Front End, but with some images, it does not match the DevTools Front End. This particular image is added by an element.appendChild dom call (I have set DOM.enable()). Any idea why DevTools Front End gets the right initiator but it’s wrong elsewhere?
Below are json snippets for the same image url, first is what I see from Java websocket, and latter is from sniffing DevTools Front End.
{
"method": "Network.requestWillBeSent", ...,
"initiator": {
"type": "other"
},
"type": "Other"
}
}
{
"method": "Network.requestWillBeSent", ...,
"initiator": {
"type": "script",
"stack": {
"callFrames": [
],
"parent": {
"description": "Image",
"callFrames": [
{
"functionName": "doWriteImage",
"scriptId": "38",
"url": "http://mycomp.com/js/write-image-function.js",
"lineNumber": 6,
"columnNumber": 9
},
{
"functionName": "window.onload",
"scriptId": "39",
"url": "http://mycomp.com/js/write-image.js",
"lineNumber": 1,
"columnNumber": 4
}
]
}
}
},
"type": "Other"
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
I did just have these 4 enabled: DOM, Page, Network and Runtime. But I just tried enabling all domains (~22 that can be enabled), and I still get the ‘Other’ initiator.
@estuetzel Cheers. you’ve been a champ at debugging this issue. 😃
cc @patrickhulce because
initiator