Skip to content

Latest commit

 

History

History
106 lines (68 loc) · 4.84 KB

research.md

File metadata and controls

106 lines (68 loc) · 4.84 KB

Research

Useful links:

Browser debugging protocols:

Articles etc:

12/10/12

Chrome for Android

iOS 6 & Safari Web Inspector

  • iOS 6 & Safari seem to communicate via the ubd process, which is the Ubiquity daemon.
  • The port that's consistently listed my machine is 64880.
  • This conneciton exists when Safari is active, even when no remote debugging is taking place.
  • Another connection seems to be set up when remote debugging another tab.

15/10/12

Opera Mini & Dragonfly

  • Opening opera:debug on Opera Mini iOS fails, seems to not be implemented.
  • The Opera Mobile Emulator works.
  • Dragonkeeper acts as proxy between a host & client, designed to make developing Dragonfly itself easier.
  • Got it to work so I could watch traffic between the emulator and the client. The docs for doing so don't mention that you don't have to have a second instance of Opera, but can use the emulator too.

General

  • Found this Remote Debugging talk very useful for understanding where we stand now.
  • Discovered the [WebDriver API] and the BTTWG – perhaps any tool that pollyfills the above should conform to this spec.

16/10/12

Dragonfly & Dragonkeeper

  • Looked into code to see what Dragonkeeper is doing with data to & from a device.
  • Running dragonkeeper with -df gives a pretty-printed output nice output of what's being sent
  • http://localhost:8002/services is being hit repeatedly hit until the device returns an xml list of services: http://i.phuu.net/KAX1

10/12/12

Firefox Beta

  • Documentation
  • An actor in an entity on the server (device) that can interact with the client (debugger) via a JSON protocol.
  • The protocol consists of JSON packets:
    • Client to server: { "to": actor, "type": type, ... }
    • Server to client: { "from": actor, ... }
  • A grip is a JSON representation of some value on the server

Installing Firefox Beta & hooking up

  • The nightly Beta release APK for the emulator
  • adb install [path to above]
  • adb forward tcp:6000 tcp:6000
  • Enable devtools.debugger.remote-enabled in client Firefox
  • Disable devtools.debugger.force-local & enable devtools.debugger.remote-enabled in FF Beta on the device
  • Restart all Firefoxes
  • Open Tools > Web Developer > Remote Debugging & connect. Click OK on the device.
  • If in Nightly, go Tools > W D > Connect

Firefox Nightly connection code:

In Firefox, open:

  • jar:file:///Applications/FirefoxNightly.app/Contents/MacOS/omni.ja!/

This file manages the connect page:

  • jar:file:///Applications/FirefoxNightly.app/Contents/MacOS/omni.ja!/chrome/browser/content/browser/devtools/connect.js

Debug Clients JSM:

  • jar:file:///Applications/FirefoxNightly.app/Contents/MacOS/omni.ja!/modules/devtools/dbg-client.jsm

Attempting to connect

  • Websocket client threw errors from the http parser
  • request('http://localhost:6002').pipe(process.stdout); also threw

The flow in FF:

  • connect.js creates a transport by running debuggerSocketConnect in dgb-client.js
    • this creates s (an nsISocketTransport) using socketTransportService.createTransport
    • it's passed the default socket type, a hostname and port, returning an instance of nsISocketTransport
    • then a transport (DebuggerTransport) is created from s.openInputStream and s.openOutputStream of the nsISocketTransport, inherited from the nsITransport
    • the transport is an non-blocking i/o stream handler

Connected!

Used node's net module to open a socket on the 6002 port. It works!