question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

initiator incorrect in Network.requestWillBeSent

See original GitHub issue

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 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"
  }
}

write-image-function.js.txt

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Sep 18, 2017

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.

0reactions
paulirishcommented, Sep 20, 2017

@estuetzel Cheers. you’ve been a champ at debugging this issue. 😃

cc @patrickhulce because initiator

Read more comments on GitHub >

github_iconTop Results From Across the Web

initiator incorrect in Network.requestWillBeSent - Google Groups
I am accessing the DevTools API (from Java) and seeing different behavior for the initiator field in Network.requestWillBeSent compared to the behavior in ......
Read more >
Network.requestWillBeSent - Vanilla Protocol Viewer
Initiator Request initiator. ... Defaults to false. ... Fired when additional information about a requestWillBeSent event is available from the network stack ...
Read more >
Network domain - Chrome DevTools Protocol - GitHub Pages
Whether the request is initiated by a user gesture. Defaults to false. Network.responseReceived #. Fired when HTTP response is available. parameters.
Read more >
2065 - Incorrect initiator in performance log - chromedriver
Hi Pavel, In the Network.requestWillBeSent events sent from DevTools to ChromeDriver, sometimes the initiator property is different from what ...
Read more >
1552325 - Implement Network.requestWillBeSent
Are watching for requests and intercept them. A very first step would be to implement a naive version of Network.requestWillBeSent and ``, before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found