Browser.theme API

Hi everyone,

In the last blog post for Firefox v55.
https://blog.mozilla.org/addons/2017/06/14/webextensions-firefox-55/comment-page-1/#comment-224016

There is support for the browser.theme, I already got this working in my Turn Off the Lights Firefox extension. And it works great! However, I got few issues:

  • It doesn’t support the “theme” as “optional_permissions” (in the manifest file)
  • Is there a way to detect the current browser theme, this set it back later

Thanks,
Stefan
Developer
www.turnoffthelights.com

1 Like

Considering this is still open, I think not:
https://bugzilla.mozilla.org/show_bug.cgi?id=1329242

Thank you Niklas for the link!

It is strange why Firefox only lets set the browser theme API. And not the “read” current theme status.

Thanks,
Stefan

Hm. It may be possible. This example assumes that there is only ever one extension of the type theme active, enabling another will disable the previous one:

But what if you use the default Firefox theme, and want to go back to this default Firefox theme.
There is no Theme extension?

Thanks,
Stefan

Apparently, there is (and there is also an entry on the about:addons page):

Hi Niklas,

Is there a way without the “management” permission?
And do you find a complete browser.theme API list. (of what you can change in the Firefox web browser)

Thanks,
Stefan

Unfortunately, this “engineering plan” is the only document with actual API information I could find. It has no date on it, but I think I ran across the very same thing at least two month ago.

This lack of documentation makes it hard to answer your other question, but I think the management API is, and will be, the way to go here.