Closed Bug 1450305 Opened 2 years ago Closed Last year

[meta] Convert ADB Helper away from a bootstrapped extension


(DevTools :: General, enhancement)

Not set


(Not tracked)



(Reporter: jryans, Unassigned)


(Blocks 1 open bug)


(Keywords: meta)


(1 obsolete file)

In bug 1449052, add-ons team is plotting removal of support for bootstrapped extensions, which impacts ADB Helper.

This is probably a good moment to reevaluate what we want ADB Helper to be today. The main features of ADB Helper are:

* One-click install of `adb` binaries (packaged inside the add-on)
  * Since these are somewhat large, the separate add-on reduces Firefox download size
* JS client code to help Firefox talk to the `adb` binary, for tasks like:
  * List Android devices with Firefox
  * Connect to Firefox for Android to enable debugging sites

Here are some ideas for what we could convert to:

A. A WebExtension with bundled Experiment which can run privileged code
  * This seems the most similar to ADB Helper as it is today
  * An demo add-on with this approach:

B. Move the "download binaries" piece into Firefox itself (instead of being an add-on)
  * On some user action, download `adb` for use by Firefox
  * The JS glue code is small and could likely be included in all builds

There are surely other pathways as well... feel free to suggest your own options.
I've started looking this.
Assignee: nobody → hikezoe
:aswan suggested to me on IRC is that the new extension can contain a JSON file and devtools extract it.  I can imagine the JSON file looks like this;

  "Linux": {
    "x86": [
    "x86_64": [
  "Darwin": {
    "x86_64": [
  "WINNT": {
    "x86": [
    "x86_64": [

And then, in devtools, we use this just like something like this;


Then we can extract each files (e.g. adb.exe) from the extension in devtools.  I believe with this approach, we don't need any experiments in the extension.  Also note that an advantage of this approach (rather than downloading binaries) is that the extension is signed by (:arai told me it).
Here is the very beginning patch.   My plan here is to port each feature in the old extension to devtools as a single commit respectively.  E.g. 1) unpacking adb binary, 2) launching the binary, etc. etc.

I am also planing to add unit tests (xpcshell tests) in each commit.  But I am stuck at the very beginning of this patch. :/  In this patch, I am trying to extract 'adb.json' in the new extension, but it doesn't work in the xpcshell test added in this patch.  The code in question actually works in about:debugging content.  When the code is invoked in the xpcshell test, ResolveURI [1] in SubstitutingProtocolHandler::NewChannel2() fails.  I am suspecting 'moz-extension' protocol isn't registered in the test, but I have no idea how to do that yet.

Product: Firefox → DevTools
Depends on: 1469054
Moving major about:debugging ng work into milestone 1, leaving m0 for prior bugfix work.
Andrew, what is the current target date to remove bootstrapped extensions?
Flags: needinfo?(aswan)
The end of the 64 Nightly cycle, currently scheduled for 10/22
Flags: needinfo?(aswan)
This turned into a meta bug, unassigning.
Assignee: hikezoe → nobody
Keywords: meta
Summary: Convert ADB Helper away from a bootstrapped extension → [meta] Convert ADB Helper away from a bootstrapped extension
Attachment #8980442 - Attachment is obsolete: true
Priority: P3 → --
Tracking the individual dependencies instead of the meta bug.
No longer depends on: 1482039
All the dependencies have been resolved.
Closed: Last year
Resolution: --- → FIXED
Thank you, Julian!
You need to log in before you can comment on or make changes to this bug.