WebExtensions and about: urls


(wsha) #1

Can WebExtensions interact with about: pages now? If not, is there any chance for them to do so in the future? I have just started trying not to use legacy add-ons. Here are a couple things I have hit so far:

  1. I tried the “Dark Mode” extension for giving Firefox a dark theme at night (previously I used Stylish). It looks great, but whenever I switch a page to Reader mode, I am blasted with a fully white background behind black text. I think this is because Reader mode uses an about: url and Dark Mode can’t apply its theme to about: urls.

  2. I am trying Vimium-FF as a replacement for VimFx. Whenever I look at a Reader mode page, or about:addons, about:debugging, etc. or addons.mozilla.org, none of the keybindings work and I have to use ctrl+Page Down to get to another page so the key bindings work again.


(Niklas Gollenstede) #2

For keybindings there is an actual hope. There already is a commands API that should work in all tabs. Firefox is currently lacking a mechanism to re-assign the keys set by the developer. I guess that why the extension isn’t using it. But a UI for that should be available at some point.

As for access to about:-pages, I don’t think that will ever change. To get around that, I am currently writing a user style manager that, among other things, uses nativeMessaging to write styles that affect the browser UI and about:-pages to the userChrome.css file. That already works very well. Below is a screenshot of Firefox Nightly 57 with such styles applied. It looks a bit ugly because the styles themselfs are not adjusted to Firefox 57 yet. I am using it in my every-day profile in Firefox 56 without major problems.

If you are genuinely interested and are willing to invest a some time in it, I can send you the extension and its native node.js app.

Oh, and for the reader mode, yes, it is an about:-page (about:reader?url=…). But you can choose a dark theme in the menu an the left side, can’t you?


(wsha) #3

Sorry, I am very behind on replying to things…

Thank you for pointing out the reader dark theme. I had overlooked that and it is quite helpful!

With Reader’s dark theme and the Dark Mode WebExtension, most of my dark theme requirements are met now. Is your userchrome.css work published anywhere now? My main complaint now is that when I open a new tab it seems that the default behavior is to show a white background until the page starts loading. When it is dark, this means I get momentarily blinded by a white screen every time I open a new tab until the page starts loading and the dark theme can be applied. Do you know if it is possible to change this? (At the moment when I try to open a link in a new tab, that tab opens without taking focus which seems to be a workaround – I can’t figure out which way of opening a new tab was blinding me before right now).

With the Reader dark theme, I am mostly okay with addons not working in about: pages. The thing I would like most is to be able to load extensions on moz-extesion: pages, so I can use Vimium to navigate the Brief RSS interface. I guess the chances of that are slim?