Check if the renderer is in a devtools window in blink for debugging purpose?

12 views
Skip to first unread message

Xianzhu Wang

unread,
Jun 13, 2018, 2:26:50 PM6/13/18
to blink-dev
Hi,

Sometimes I debug a blink bug in a live third-party web page. The bug has been worked around in the web page, so I need to modify some style to reproduce the bug with devtools. I also need to print a lot of logs about the painted results for analysis, but the devtools' renderer make the log output very verbose, so I would like to exclude devtools from the logs.

Is it possible to programatically check in blink whether the renderer is in a devtools window?

Steve Kobes

unread,
Jun 13, 2018, 2:41:15 PM6/13/18
to Xianzhu Wang, blink-dev
What I usually do is add a hook to WebLocalFrameImpl::CommitNavigation like:

LocalFrame* g_frameOfInterest;

void WebLocalFrameImpl::CommitNavigation(...) {
  if (request.Url().GetString() == "http://www.badpage.com")
    g_frameOfInterest = GetFrame();
  ...
}

Then I make my logging conditional on current frame == g_frameOfInterest.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADBxrif2rOT0f1y6ZOmqzYg5nM9kwYrfSCST0EFAR879XSa7hg%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages