initiator incorrect in Network.requestWillBeSent

166 views
Skip to first unread message

Ezra Stuetzel

unread,
Sep 14, 2017, 4:17:14 PM9/14/17
to chrome-debugging-protocol
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",
              "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"
  }
}

Pavel Feldman

unread,
Sep 14, 2017, 4:24:56 PM9/14/17
to Ezra Stuetzel, chrome-debugging-protocol
Could you post your question at https://github.com/ChromeDevTools/devtools-protocol ?

--
You received this message because you are subscribed to the Google Groups "chrome-debugging-protocol" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-debugging-protocol+unsub...@googlegroups.com.
To post to this group, send email to chrome-debugging-protocol@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chrome-debugging-protocol/92a8a29e-1648-42e8-b143-fb982d20a6e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ezra Stuetzel

unread,
Sep 14, 2017, 5:25:46 PM9/14/17
to chrome-debugging-protocol
To post to this group, send email to chrome-debug...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages