Skip to content

Instantly share code, notes, and snippets.

View juliandescottes's full-sized avatar

Julian Descottes juliandescottes

View GitHub Profile
class Front {
async initialize() {
throw new Error("initialize Mandatory");
}
static async createFront() {
const front = new this();
await front.initialize();
return front;
}
# HG changeset patch
# User Julian Descottes <[email protected]>
# Date 1543267098 -3600
# Mon Nov 26 22:18:18 2018 +0100
# Node ID f92035925ff9210741b524eb68455d1bb5f6cb3e
# Parent bd490139b395d47c6f1b4af6cf34f572a1902fe2
Bug 1497457 - Fix aboutdebugging systemaddons test after signature change;r=test-only
diff --git a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_system_addons.js
diff --git a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js
--- a/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js
+++ b/devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js
@@ -8,24 +8,27 @@
*/
add_task(async function() {
prepareCollapsibilitiesTest();
const { document, tab } = await openAboutDebugging();

Build Firefox for Android

When do you need to build Firefox for Android

If a remote debugging change impacts the server (file located in devtools/server or in devtools/shared), you will not be able to test it with a device which runs the release version of Firefox for Android. For the purpose of remote debugging, your local build of Firefox Desktop where you will test about:debugging runs the content of devtools/client (including devtools/client/aboutdebugging-new). And devtools/server runs on the device. So as soon as you are developing or testing a patch that needs to update the server and is about USB debugging, you need to build Firefox for Android and deploy it on a test device.

Setup your environment

This will be a short documentation focused on the typical patches you may write for about:debugging. For a more complete documentation, you can refer to https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_for_Android_build.

about:debugging-new

What is about:debugging-new

The purpose of about:debugging is to be a debugging hub to start inspecting your addons, processes, tabs and processes. This new version of about:debugging will also allow you to debug remote devices (Firefox for Android on a smartphone). The user should be able to connect either via USB or WiFi. This solution is supposed to replace the various existing remote debugging solutions available in Firefox DevTools, WebIDE and the Connect page.

To try about:debugging-new, the preference devtools.aboutdebugging.new-enabled needs to be set to true in about:config. After that, the UI is available by going to about:debugging.

Technical overview

The about:debugging-new UI is built using React and Redux. The various React/Redux files should be organized as follows:

[alias]
wip = log --graph --rev=wip --template=wip
who = !$HG anno -u $1 | awk '{print $$1}' | sort | uniq -c | sort -r
amend = commit --amend
nuke = !$HG revert --all --no-backup ; $HG purge
now = !$HG parent | grep summary
next = !$HG up $($HG log -r . --template '{children}\n')
prev = up .^
# HG changeset patch
# User David Walsh <[email protected]>
# Date 1539048226 18000
# Mon Oct 08 20:23:46 2018 -0500
# Node ID 7931d57e3eae80a92ee485f9277762c713f37e6c
# Parent b37cb2cbe0872efd25c46050302a28a51efd5dc5
Bug 1314057 - Move worker actor and console tests to shared
diff --git a/devtools/client/debugger/test/mochitest/browser2.ini b/devtools/client/debugger/test/mochitest/browser2.ini
--- a/devtools/client/debugger/test/mochitest/browser2.ini

createTargetForTab, step by step

  • DebuggerServer.init() This actually doesn't do much. It creates a _connections map/object, initializes the actor registry with this map (currently empty). Despite the name, this mostly does nothing.

  • DebuggerServer.registerAllActors() This does two things. First it registers all the browser and target actors in the actor-registry. This will allow to dynamically create any of those actors later on. Then it creates a factory for the root actor. In the same way as the other actor, the root actor is not created here, but a factory is prepared and we will invoke it as soon as we establish connections for this Server

  • new DebuggerClient(transport)

createTargetForTab, step by step
- DebuggerServer.init()
This actually doesn't do much. It creates a _connections map/object, initializes the
actor registry with this map (currently empty). Despite the name, this mostly does nothing.
- DebuggerServer.registerAllActors()
This does two things. First it registers all the browser and target actors in the actor-registry. This will allow to dynamically create any of those actors later on. Then it creates a factory for the root actor. In the same way as the other actor, the root actor is not created here, but a factory is prepared and we will invoke it as soon as we establish connections for this Server
- new DebuggerClient(transport)
@juliandescottes
juliandescottes / statichelperadbextension.patch
Created October 2, 2018 08:05
static helper adb extension
# HG changeset patch
# User Julian Descottes <[email protected]>
# Date 1538465251 -7200
# Tue Oct 02 09:27:31 2018 +0200
# Node ID 4edce7cd93d3d1d2d3020d26427945b837a84dd7
# Parent ceeb1c7d62517f4ac960f1adaf75b2a506c1183a
add static helper WIP WIP WIP
diff --git a/devtools/client/webide/modules/addons.js b/devtools/client/webide/modules/addons.js
--- a/devtools/client/webide/modules/addons.js