Overview
Theglide.prefs API provides methods for reading and writing Firefox preferences (about:config settings). This allows you to customize Firefox behavior directly from your glide.ts configuration file, eliminating the need for a separate prefs.js file.
Firefox preferences are low-level settings that control browser behavior. You can view all preferences by navigating to
about:config in Firefox.Learn more about about:configMethods
set()
Set a preference value.The name of the preference to set. This should be a valid Firefox preference key.
The value to set. The type must match the preference’s expected type:
- Boolean preferences accept
trueorfalse - Integer preferences accept numbers
- String preferences accept strings
get()
Get the value of a preference.The name of the preference to retrieve.
The preference value, or
undefined if the preference is not defined. The return type matches the preference’s actual type.clear()
Reset a preference to its default value.The name of the preference to reset.
After calling
clear(), the preference will return to its Firefox default value. If the preference was user-defined (not a built-in Firefox preference), it will be removed entirely.scoped()
Create a scoped preferences manager for temporary preference changes.A scoped preferences object that supports:
set(name, value): Set a temporary preferenceget(name): Get a preference valueclear(name): Clear a temporary preference- Automatic cleanup when the scope exits (via
Symbol.dispose)
Scoped preferences are determined by the lifetime of the return value. When the scoped object goes out of scope (block ends, function returns, etc.), all preferences are automatically restored to their previous values.
Buffer-Specific Preferences
You can also set preferences that apply only to the current buffer (tab) usingglide.buf.prefs:
Buffer Prefs vs Global Prefs
Buffer Prefs vs Global Prefs
Global Prefs (
glide.prefs):- Apply browser-wide
- Persist across all tabs and windows
- Survive browser restarts (if set in config)
glide.buf.prefs):- Apply only to the current tab
- Reset when navigating to a different tab
- Useful for tab-specific customizations
Complete Examples
Custom Browser Behavior
glide.ts
Developer Settings
glide.ts
Privacy & Security
glide.ts
Dynamic Preference Toggle
glide.ts
Common Preferences Reference
View common Firefox preferences
View common Firefox preferences
Tab Behavior
browser.tabs.closeWindowWithLastTab- Close window when last tab closesbrowser.tabs.warnOnClose- Warn when closing multiple tabsbrowser.tabs.tabMinWidth- Minimum tab width (pixels)browser.tabs.animate- Enable tab animations
ui.prefersReducedMotion- Reduce animations (0=off, 1=on)layout.css.devPixelsPerPx- UI scale factortoolkit.legacyUserProfileCustomizations.stylesheets- Enable userChrome.css
privacy.trackingprotection.enabled- Enable tracking protectionnetwork.cookie.cookieBehavior- Cookie policy (0=accept all, 1=reject third-party, etc.)dom.security.https_only_mode- HTTPS-only mode
browser.cache.disk.enable- Disk cachebrowser.cache.memory.enable- Memory cachebrowser.sessionstore.interval- Session save interval (milliseconds)
devtools.chrome.enabled- Enable browser toolboxdevtools.debugger.remote-enabled- Enable remote debugging
about:config in Firefox.Type Reference
glide.ScopedPrefs
using keyword.