Mehmet Baker
Mehmet Baker

Reputation: 1155

web-ext: How to run Firefox in dark mode?

I'm working on a new browser extension and I'm using Mozilla's web-ext tool to test it. I couldn't figure out how to run the test browser in dark mode.

So far I have tried this:

web-ext run --verbose --pref [email protected]

Upvotes: 0

Views: 274

Answers (1)

Mehmet Baker
Mehmet Baker

Reputation: 1155

I figured out a way! Apparently, dark mode is an add-on; not a preference.

First step is to create an empty directory to store our Firefox profile.

mkdir ../dark-mode-profile
npx web-ext run -p ../dark-mode-profile --keep-profile-changes

Then enable dark mode and close Firefox (and hit Ctrl-C if necessary). Since we turned on the --keep-profile-changes flag, all the changes we made are now stored in our profile folder.

We can run Firefox with this profile:

npx web-ext run -p ../dark-mode-profile

Upvotes: 0

Related Questions