[webkit-dev] WebKit Remote Web Inspector
Vienneau, Christopher
cvienneau at ea.com
Fri Jun 20 18:07:44 PDT 2014
Hi Joseph,
I came across this bit of documentation shortly after sending my first mail:
https://www.webkit.org/blog/?p=1875&preview=true. (Running WebSocket server in your port)
Which if it's still accurate, then it explains why I didn't find any listening code, since it says:
In order to use the default Web Inspector front-end for the remote debugging of your WebKit port, you need to implement a small web server supporting the WebSocket specification. We did not make this server code a part of the WebCore because it is up to the embedder to be listening for external connections and discover the inspectable pages.
However your response leads me to believe that it could be as easy as enabling a define? Searching my code for INSPECTOR_SERVER I only find it in FeatureDefinesNix.h but no source code wrapped by it. REMOTE_INSPECTOR does not show up at all. Should I see source using these defines or do I misunderstand? I'm guessing the port being used here doesn't have the things you mentioned in it; which is "Cairo". I expect the server portion needed to implement isn't too difficult, and I suppose the other ports could be used as examples.
Chris
From: Joseph Pecoraro [mailto:pecoraro at apple.com]
Sent: Friday, June 20, 2014 5:37 PM
To: Vienneau, Christopher
Cc: webkit-dev at lists.webkit.org
Subject: Re: [webkit-dev] WebKit Remote Web Inspector
Hello,
Yes, this is possible. There are currently two paths to making Web Inspector work across processes.
1. ENABLE(INSPECTOR_SERVER)
Currently enabled by GTK and EFL. The UIProcess process establishes an HTTP Web/WebSocket server. The index page is a listing page which advertises information about each of the different WebViews that can be inspected. For each of these there is a page which fetches the HTML web inspector frontend assets (WebInspectorUI) and then establishes a WebSocket connection back to the UIProcess to send and receive inspector protocol messages.
Pros:
- easy to implement and setup
- a compatible web inspector frontend is downloaded on demand, so it should be guarenteed to work
- debugger could just be another web browser (you will get best results when that other browser is a WebKit based browser)
Cons:
- pull based, debugger needs to fetch an updated listing
- frontend features can be limited when run in a generic web environment (non-native context menus, no copy/paste, no system beep, etc)
2. ENABLE(REMOTE_INSPECTOR)
Currently enabled by Mac and iOS. Very port specific right now. Uses XPC to communicate to a middleman process that advertising and helps set up connections for the inspector protocol messages.
Pros:
- push based. As WebViews are created, destroyed, or change, they can advertise updates to debuggers
- using XPC the middleman process can check privileges of each side
Cons:
- frontend is not downloaded, so it requires having a debugger process with a frontend that will work with whatever it is connected to
- not implemented in other ports, would take port specific work to get this path up and running in other ports
If this is just something you want to get up and running to make debugging as a developer easier, it sounds like ENABLE(INSPECTOR_SERVER) would work well for you. Depending on your port, there should be settings for enabling and configuring the inspector server (e.g. port # for the server to listen on) and it should be easy to get up and running.
What port are you working on?
- Joe
On Jun 20, 2014, at 4:11 PM, Vienneau, Christopher <cvienneau at ea.com<mailto:cvienneau at ea.com>> wrote:
Hi,
I'm investigating the possibility of getting access to the "Web Inspector" UI http://trac.webkit.org/wiki/WebInspector#no1 remotely via another browser/process. This is useful when attempting to debug a page on a device that doesn't have the same screen real estate as your PC, such as a mobile device. I'm familiar with "Weinre" http://people.apache.org/~pmuellr/weinre/docs/latest/Home.html which offers many of the features of Web Inspector in a fashion that I'm talking about; but some important elements are missing, such as profiling and java script debugging. I found "heX" https://github.com/netease-youdao/hex is able to do what I want, but I would like to be able to accomplish the same thing from WebKit itself, since the target platform isn't on the pc. Searching through the WebKit source code I can't find any trace of it having the ability to open a listening port to have a debugging client attach.
Is such a thing already possible? The docs, and older mail threads suggested that remote operation was once a goal of Web Inspector, does work continue on this vein? Please offer any suggestions on how this might be accomplished.
Thanks
Chris Vienneau
_______________________________________________
webkit-dev mailing list
webkit-dev at lists.webkit.org<mailto:webkit-dev at lists.webkit.org>
https://lists.webkit.org/mailman/listinfo/webkit-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20140621/f8225c18/attachment.html>
More information about the webkit-dev
mailing list