- See /ublock for a page on uBlock Origin
- See /aboutconfig for a page on
about:config
preferences. - See /firefox-android for scattered notes about the Android version
Links
- Homepage is https://www.mozilla.org/en-US/firefox/
- Searchfox lets you search Firefox source code
-
Bugzilla is where bugs/features are tracked.
- Firefox Source Docs documents different components of Firefox, from a developer perspective
- Firefox release notes for developers - Fun to read to find new/interesting web features
User styles
User styles let you apply your own CSS to webpages (either specific sites or the whole web).
Steps:
- In
about:config
settoolkit.legacyUserProfileCustomizations.stylesheets
totrue
. - Find or create the file
~/.mozilla/firefox/xxxxx.yourprofile/chrome/userContent.css
(you may need to create thechrome
directory). - You may need to restart Firefox if you’re newly creating this file.
Reloading userContent.css
I couldn’t initially find out why some user styles weren’t taking effect.
This StackOverflow answer about reloading userContent.css
gave the solution:
Close any tabs with the targeted domain open, then make a new tab.
That is, if you’re styling @-moz-document domain(en.wikipedia.org)
, you’ll need to close all en.wikipedia.org
tabs, then make a new tab.
Wikipedia MathML
(Maybe I should move this in a separate “Wikipedia” page)
I like copying math in Wikipedia to make Anki flashcards. But rather than clicking the “edit” button, finding the LaTeX, and copying that, I’d like to display the LaTeX directly. Wikipedia has a page on how to display formulas which links to the CSS from the NativeML extension, which I’ve modified here (and kept under the same MPL license).
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@namespace math url(http://www.w3.org/1998/Math/MathML);
@-moz-document domain(en.wikipedia.org) {
/* ---------- Copied from https://github.com/fred-wang/webextension-native-mathml/blob/master/content-scripts/mediawiki.css ---------- */
/* Reset some CSS properties set by MediaWiki and hide the image fallback */
.mwe-math-mathml-a11y {
clip: auto !important;
overflow: visible !important;
position: static !important;
width: auto !important;
height: auto !important;
opacity: 1 !important;
display: inherit !important;
}
body.mediawiki .ve-ce-mwLatexNode .mwe-math-mathml-a11y {
/* override https://phabricator.wikimedia.org/diffusion/EMAT/browse/master/modules/ve-math/ve.ce.MWLatexNode.css */
display: inherit !important;
}
/* Support where MediaWiki lazy loaded images */
.mwe-math-mathml-inline ~ .lazy-image-placeholder,
.mwe-math-mathml-display ~ .lazy-image-placeholder,
/* Support where MediaWiki doesn't lazy load images */
.mwe-math-mathml-inline + .mwe-math-fallback-image-inline,
.mwe-math-mathml-display + .mwe-math-fallback-image-display {
display: none !important;
}
/* ---------- End copied ---------- */
*:is(:hover,:focus) > math|annotation {
display: block;
user-select: all;
border: 1px solid lightblue;
font-size: 0.5rem;
font-family: monospace, monospace;
position: absolute;
top: 0px;
left: 0px;
}
}
/* Local Variables: */
/* tab-width: 4 */
/* css-indent-offset: 4 */
/* indent-tabs-mode: t */
/* End: */
![A screenshot showing that hovering over an equation shows the LaTeX used to generate it](firefox/wikipedia-mathml-userstyle.png)
Special URLs
URL | Description |
chrome://browser/content/places/historySidebar.xhtml |
This is what shows up in the history sidebar. |
chrome://browser/content/places/places.xhtml |
The library of bookmarks |
about:about |
Find all the about: pages. |
Disabling Javascipt after page loaded
Go to the browser console which is Ctrl+Shift+J. I noticed that there was no place to actually enter in JavaScript.
Set devtools.chrome.enabled
to true
in about:config
.
Then you do get a JavaScript command line.
At the JavaScript command line, enter gBrowser.selectedBrowser.browsingContext.allowJavascript = false
Android
See also /firefox-android.
You can install Firefox Nightly using an APK from https://ftp.mozilla.org/pub/fenix/. There’s also an app called FFUpdater (on F-Droid) that’ll download the latest one automatically.
Extension/add-on shortcuts/hotkeys
To manage the hotkeys for add-ons, or shortcuts for extensions, go to about:addons
and then click on the settings gear and click “Manage Extension Shortcuts”.
For example, for uBlock Origin I set hotkeys for element picker, element zapper. This is also where you’d go to change the hotkeys for Firefox Multi-Account Containers.
Extra reasons I like Firefox
Or rather, some things Firefox is somewhat better at than other user agents.
- The biggest reason for me is that it’s free software or actually “open source”. While Google Chrome, Apple Safari, and Microsoft Edge use open source components, they are include proprietary components and have unfree licenses. Chromium is open source, but Chrome isn’t. WebKit is open source, but Safari isn’t.
- Scripting support in SVG. Strangely, only Firefox seems to support ECMAScript Modules within SVG documents. See https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script.
-
Containers/contextual identities.
I should document Firefox Multi-Account Containers, but until I do I’ll just mention that Firefox web extensions can take advantage of containers. See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/contextualIdentities.
- Supports ECMAScript modules in XML-serialized HTML documents (i.e.
<script type="module"/>
inapplication/xhtml+xml
). Chromium can’t handle it unless it also has theasync
attribute. Safari/WebKit just can’t handle it at all, and don’t correctly fall back to loading “nomodule
”. - Supports extensions both on desktop and mobile. Chrome doesn’t seem to support extensions on mobile.
Things I haven’t figured out
-
GettingNever mind. It looks like this is now working with NixOS 23.11; Firefox is compiled withSpeechSynthesis
API to work in Linux or NixOS specifically. I think it has something to do withspeech-dispatcher
.speech-dispatcher
support. You can then usespd-conf
fromspeech-dispatcher
to configure with TTS backend is used. Espeak has a ton of different voices.