Can I call the Debugger API from my add-on?

Hello! I am trying to migrate a Chrome extension to Firefox. The original extension utilizes chrome.debugger to attach to active tab and collect user actions’ performance metrics and network requests-responses.
I am trying to find similar functionality in Firefox.

First, I found there is devtools client module
https://firefox-source-docs.mozilla.org/devtools/backend/client-api.html
Unfortunately, I couldn’t find the way to import
resource://devtools/server/devtools-server.js
resource://devtools/client/devtools-client.js
to my background script because resource:// urls are prohibited to use.

Next, there is the Debugger API


I can’t make it work because it should be run in the browser content not in background script content.

Is there any way to attach a debugger from an addon to active tab and use its API?

Sadly all you can use from within an extension that is related to the devtools is what’s exposed via https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools

You could probably proxy debugging API interactions through a native application…

2 Likes