Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Debugging an addon over usb for ff android

16 views
Skip to first unread message

Ethan Drower

unread,
Nov 2, 2016, 5:49:18 AM11/2/16
to mozilla-dev-d...@lists.mozilla.org
Hi everyone,



I'm able to debug firefox on my android device via usb (using the adb debug tool in webIDE), but am having trouble seeing any output/errors from an extension I'm running on the mobile device.

Normally (on desktop) I would open a separate extension debugging console via about:debugging. Since that's not an option on mobile, I tried enabling js errors with the javascript.options.showInConsole and extensions.logging.enabled properties and still haven't had any luck.

Any ideas on how to get the typical output from an extension (background.js etc.) to show up in the webIDE debug console when connected to the device over usb? The documentation is very clear on viewing the regular js console over usb, but I haven't been able to find anything on webextension/addon debugging over usb.

any help is much appreciated!

Luca Greco

unread,
Nov 2, 2016, 8:07:08 AM11/2/16
to Ethan Drower, mozilla-dev-d...@lists.mozilla.org
Hi Ethan,
Currently the workflow to reach and debug a WebExtension running on a
remote Firefox for Android browser is definitely not as nice and simple as
it is on a Firefox Desktop (where it is as simple as "click the debug
button in the about:debugging#addons page"), but in the meantime you should
be able to reach a WebExtensions background page context using the
following steps:

- connect the remote android target using the WebIDE
- select the "Main Process" (from the left side of the WebIDE window, under
"runtime apps")
- select the background page of your addon from the frame list selector (
https://developer.mozilla.org/en-US/docs/tools/Working_with_iframes)

Once the webextension page has been selected in the frame list selector,
you should be able to run javascript code in that context from the
webconsole, and inspect the content of the document loaded in that context
from the inspector, and errors and console messages generated from the
webextension should be visible in the webconsole (actually, error and
console messages should be visible as soon as you have been able to connect
the "Main Process", even without selecting the background page from the
frame list seletor).

Let me know how it goes, especially if you have issue to reproduce the
above steps, or if they didn't worked for you (if it doesn't work, it can
be helpful to keep track of the Firefox versions that you are using on the
desktop and android, so that I can help you to track down the reasons that
prevent you to successfully connect the DevTools client running on the
desktop side to the WebExtension page running on Android).

Best,
Luca
0 new messages