JMM’s notes on

Firefox

The world’s greatest web browser

User styles

User styles let you apply your own CSS to webpages (either specific sites or the whole web).

Steps:

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
Hovering over an equation shows the LaTeX used to generate it.

Special URLs

URLDescription
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

javascript - Is it possible to kill all scripts on a webpage after loading the page in Firefox? - Super User

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

Things I haven’t figured out