HarlanGertz
HarlanGertz

Reputation: 11

WebExtension Firefox - Disable temporarily other add-ons

I'm looking to disable (for a few seconds) other add-ons installed on the browser, then to re-enable them.

My option right now:

Management API (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/management) - doesn't work on Webextensions Firefox.

Are you familiar with a method of either :

a. Disabling a specific add-on for a short time. b. Opening a new window with all add-ons disabled.

Thanks, Harlan

Upvotes: 1

Views: 817

Answers (2)

Makyen
Makyen

Reputation: 33396

There is no way to accomplish what you desire from a WebExtension. Even in Firefox 55, where management.setEnabled() exists, that API is only permitted to enable and disable themes, not regular extensions.

You can accomplish this from other types of Firefox extensions, but not a WebExtension.

Upvotes: 2

Timur
Timur

Reputation: 46

If your purpose is debugging/testing an addon, then here is two ways to achive

b. Opening a new window with all add-ons disabled

1. using web-ext tool

There is a command line tool called web-ext to help develop web-extensions for Firefox. This tool allows run your addon on a temporary default profile. Since a default profile does not have any user-installed extensions, it is what you could use.

  1. Install web-ext
  2. Go to your addon directory cd <your_addon_directory>
  3. Run web-ext web-ext run

From MDN:

web-ext run Builds and then temporarily installs an extension on Firefox so it can be tested. By default, this will also watch all extension source files and reload the extension in Firefox as files change.

More info about using web-ext on Mozilla Developer Network: Getting started with web-ext

2. Manually

With this option you need to run a default profile manually using Firefox Profile Manager. Here you can read instruction how to work with Firefox profiles. You can create a separate profile specially for testing your addons. After starting Firefox with that profile go to about:debuggingpage and load your addon.

Upvotes: 0

Related Questions