<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Whoever hosts the Web Inspector frontend page has the real connection to the backend. The host provides an InspectorFrontendHost global object to the frontend page that can be used to send messages through that already established connection. Likewise when the host wants to trigger operations in the frontend page it calls methods on InspectorFrontendAPI.</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">• The frontend page uses InspectorFrontendHost.sendMessageToBackend to send JSON Inspector Protocol messages to the backend. This is never used directly, we generate APIs that construct the JSON messages that get sent through this.</div><div class=""><br class=""></div><div class="">• The frontend page receives messages from the backend through InspectorFrontendAPI.prototype.dispatchMessageAsync. Again generated APIs route these incoming messages to more convenient places such as domain observers or callbacks for earlier commands.</div></blockquote><div class=""><br class=""></div><div class="">On the native side you can look at WebInspectorProxy::sendMessageToBackend to see how the frontend host's native connection to the backend is used and related code to see how it was established. Ultimately only a Inspector::FrontendChannel needs to be provided to WebCore's InspectorController to establish a backend <-> frontend connection. So you can set a breakpoint on WebCore::InspectorController::connectFrontend and see how / where it gets triggered. The common case in WebKit2 happens under WebKit::WebInspector::show.</div><div class=""><br class=""></div><div class="">- Joe</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Feb 24, 2017, at 5:33 AM, kwadwo amankwa <<a href="mailto:citisolo@gmail.com" class="">citisolo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi all,<br class=""><br class="">Just studying the Inspector code and interested to know how(or where) the Inspector front-end connects to the backend.<br class=""><br class=""></div>cheers</div>
_______________________________________________<br class="">webkit-dev mailing list<br class=""><a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class="">https://lists.webkit.org/mailman/listinfo/webkit-dev<br class=""></div></blockquote></div><br class=""></body></html>