Links
- 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
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: */
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
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.
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.