Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aminomancer committed Dec 5, 2021
1 parent 67b3e14 commit 683b013
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Because [theme addons](https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExt

Firefox's frontend uses JavaScript (a human-readable, interpreted scripting language) for a huge variety of dynamic/interactive features. ***A JavaScript file is typically called a script. For the purposes of this theme, a script is a file ending in `.js` or `.jsm`***. As it happens, Firefox exposes a mechanism for loading _custom_ scripts. That mechanism involves giving Firefox an [autoconfig file](https://www.userchrome.org/what-is-userchrome-js.html), which is actually a JavaScript file. At runtime, the autoconfig file has access to the same powers as Firefox's internal scripts. We can use it to run JavaScript code or even load additional script files. So, whereas most other themes are purely visual, this theme can and does create new elements, shortcuts, and dynamic behavior.

A third, lesser known avenue for customization is Firefox's [component registrar](https://searchfox.org/mozilla-central/source/xpcom/components/nsIComponentRegistrar.idl). This is a pretty arcane object called an XPCOM interface, so don't worry about the details — Firefox uses this system to organize itself. Instead of using absolute paths, most of the time the Firefox frontend uses special URLs to reference its internal files. For example, the "new tab" icon is located at `chrome://browser/skin/new-tab.svg`. This corresponds to a local path that's been registered to this URL. We can use the registrar to do the same thing, register `chrome://` URLs or _override_ existing ones. If I don't like Firefox's "new tab" icon, I can just replace it by passing a [manifest file](#resources--manifest). That means we don't need to use CSS to modify every element that uses the icon and update that CSS every time one of them is changed. ***For the purposes of this theme, a manifest file is a file ending in `.manifest`***.
A third, lesser known avenue for customization is Firefox's [component registrar](https://searchfox.org/mozilla-central/source/xpcom/components/nsIComponentRegistrar.idl). This is a pretty arcane object called an XPCOM interface, so don't worry about the details — Firefox uses this system to organize itself. Instead of using absolute paths, the Firefox frontend usually uses special URLs to reference its internal files. For example, the "new tab" icon is located at `chrome://browser/skin/new-tab.svg`. This corresponds to a local path that's been registered to this URL. We can use the registrar to do the same thing: to register `chrome://` URLs or _override_ existing ones. If I don't like Firefox's "new tab" icon, I can just replace it by passing a [manifest file](#resources--manifest). That means we don't need to use CSS to modify every element that uses the icon and update that CSS every time one of them is changed. ***For the purposes of this theme, a manifest file is a file ending in `.manifest`***.

Firefox also has a _preferences_ system, which can be managed by navigating to `about:config`. A preference (or pref) is simply a key-value pair. Pref keys are always [strings](https://wikipedia.org/wiki/String_(computer_science)), and their values can be strings, integers, or [Boolean](https://wikipedia.org/wiki/Boolean_data_type). Firefox has several thousands of prefs, which are used for all sorts of things from major configurations to obscure mods and even simply counting events. Firefox's UI can be visually customized to some extent using prefs. Since we can make our own prefs, I also use them to make customizing this theme easier. The most important prefs are listed below in the [settings section](#recommended-settings). Some individual scripts have prefs as well, which will be listed in their [descriptions](#script-descriptions--links).

Expand Down

0 comments on commit 683b013

Please sign in to comment.