I 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 json, however the json from the 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 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",
"lineNumber": 6,
"columnNumber": 9
},
{
"functionName": "window.onload",
"scriptId": "39",
"lineNumber": 1,
"columnNumber": 4
}
]
}
}
},
"type": "Other"
}
}