Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

firefox-scripts

> 编程语言
Open source

userChromeJS / autoconfig.js and extensions

1.4K stars0 likes2 views
WebsiteGitHub

About

userChromeJS / autoconfig.js and extensions

userChromeJS

Tested on Firefox Developer Edition 131.0b4.

Instructions

Video running installation steps below: https://youtu.be/_4fdUdp3G4o

  1. Download this zip file and extract its content to Firefox installation folder (usually C:\Program Files\Mozilla Firefox). For Linux paths, read this. And this for macOS paths.

  2. Click Firefox menu button (☰) -> Help -> More troubleshooting information or simply open about:support. Find "Profile Folder", then click "Open folder". In there, create a new folder called chrome.

  3. Download one of the files below and extract its content in chrome folder.

  • utils → I'm only interested in scripts

  • utils → I'm only interested in extensions

  • utils → I'm interested in both scripts and extensions

Now, if you're only interested in extensions, you can skip to step 6.

  1. Save the desired userChromeJS scripts into chrome. Read below the description of some of them.

  2. If you want a button to manage your scripts, including the ability to disable/enable scripts without needing to restart¹ Firefox or Thunderbird, save rebuild_userChrome.uc.js into chrome.

  3. Open about:support and click "Clear startup cache…" to force Firefox to load userChromeJS on the next startup.

  4. Restart Firefox.

¹: Not all scripts are restartless. These have @shutdown at the beginning of the code. Almost all scripts on this page were written by me to be restartless, but almost all scripts you get from other sources are not.

userChromeJS scripts

ᵀᴮ: also compatible with Thunderbird

(click to expand)

BeQuiet The main purpose of this script is to control media without having to select the tab playing it. So I can play/pause a YouTube video or skip to the next song in Deezer while browsing Reddit, for example. Three hotkeys are defined by this script: Ctrl+Alt+S to play/pause, Ctrl+Alt+D to next song and Ctrl+Alt+A to previous song.

Besides that, no more than one tab should play audio at the same time. Each tab paused by another tab that starts playing is added to a stack. So if I open a new YouTube video while there's already one playing, the new tab starts playing and the other is paused. When the video ends or when I pause it, the first YouTube tab resumes playing.

As for now, I only added support for a few sites, like Deezer, Spotify and YouTube. I chose not to support next/previous in YouTube, only play/pause.

Download link.

Enter Selects

Have you ever been frustrated because you wanted Firefox to autofill https://www.youtube.com/feed/subscriptions when you type "youtube" in location bar? That's because Firefox only autofills domains, so it doesn't go beyond https://www.youtube.com/. Also because of this, Firefox will never autofill https://www.reddit.com/r/firefox/ when you type firefox, no matter how many times you've visited that page. A common case is new Firefox users complaining that browser isn't autocompleting gmail.com after typing gm.

I don't like this. Firefox should be smart to always prioritize the page with higher visit score in browser history. That's what this script fixes. It preselects the first suggestion from address bar. For instance, if this page is the first suggestion when you type xiaoxiaoflood, you don't need to press down arrow key before Enter.

Pages you often visit always rise to the first position, so accessing any frequent page will be as easy as typing no more than three chars + Enter, like just you + Enter to load YouTube Feed directly instead of YouTube homepage. It's even possible to teach Firefox to load YouTube Feed with y and YouTube Homepage with yo, it's just a matter of practice.

This script replaces urlbar autocomplete, so browser.urlbar.autoFill is disabled on install. If at any time you miss domain autofill, you still sort of can achieve that by pressing Tab IF the domain of first suggestion matches what you've typed so far. Example: you typed git and the first suggestion is from github.com. Pressing Tab key will autocomplete the domain even if the first suggestion is not just github.com - it may be github.com/whatever. But if the typed input doesn't match the domain of the first suggestion, then Tab key will have default behavior of selecting next suggestion just like down arrow key.

By default, first entry is only selected if typed input is a single word. That's because when I type multiple words I'm probably wanting to make a search with my default search engine, not to load a URL from history. You can change that if you want: find AUTOSELECT_WITH_SPACE at the beginning of the code of this script, replace false by true, save then reload.

Download link.

Extension Options Menu A single toolbar button to manage all your extensions. It opens a menu listing each extension. Left-click to open Options from the hovered addon, right-click to enable/disable, Ctrl + right-click to uninstall. Hover anywhere on the menu to see more.

Screenshot:

Download link.

Extensions Update Checker Firefox checks for available addon updates every 24 hours. You can disable autoinstall updates, but then you'll only know there are available updates if you manually open Add-ons Manager. This script:
  • Disables autoinstall updates for every addon.
  • Just after the daily check, if there's an addon update available it will open Add-ons Manager directly in "Available Updates" view, so that you can track changes before updating (you can click on the extension, then click "Release Notes" button).
  • You can fill ignoreList if you are deliberately using an outdated version of an extension and don't want to be notified that an update is available.

Download link.

ᵀᴮ Master Password+ Locks Firefox with password. This will prompt the password on browser startup or anytime when you lock it with Ctrl+Alt+Shift+W.

You need to set a master password in Firefox Options > Privacy & Security > [×] Use a Primary Password.

Download link.

Locked:

Unlocked:

MinMaxClose Button Toolbar button to replace native window buttons (minimize, maximize and close). I use Sidebery (vertical tabbar) with hidden titlebar, so I need this.
  • Left-click to minimize (so I can't close it accidentally).

  • Right-click to close.

  • Middleclick restores to fixed position/size (edit script code with your preferred values). If you want to restore to previous position/size, use Shift + Middleclick.

Download link.

Mouse Gestures More powerful than any mouse gestures WebExtensions. But it doesn't have user interface and I have only included actions I use, so unless the default set of actions suits you, knowledge in JavaScript is required to write extra actions. However, it's easy to change gestures for available actions. Default gestures are at the beginning of the code (search for GESTURES:). Some of them:
  • Hold right-click, then roll mouse wheel up or down to switch to next/previous tab.
  • Hold right-click, move down and release to scroll to bottom of the page (or move up to go the top). If the cursor was over an image, moving down will open a new tab for reverse image Google search instead of scrolling to bottom.
  • Hold right-click, then left-click to switch to the last selected tab.
  • Hold left-click, then right-click to reload current tab.
  • Hold right-click, then middle-click (wheel button) to close current tab.
  • Hold right-click, move left and release to copy URL of link or media under the cursor.
  • Hold right-click, move right and release to open a new tab with the link or media under the cursor.
  • Hold middle-click, move left and release to copy selected text or image under the cursor.
  • Hold middle-click, move right and release to paste.
  • Hold left-click, then press forward button (for mouse with extra buttons) to switch to next group/panel (specific compatibility with Sidebery extension).

Gestures are cumulative if possible, so holding right-click + turning mouse wheel will activate a different tab for each "tick" in the wheel.

Advantages over existing extensions:

  • Extensions can't run over Firefox interface, so gestures don't work over Firefox toolbars.
  • Extensions can't run on privileged pages like about:config and view-source.
  • Extensions need the page to start loading to run, causing gestures to fail sometimes.
  • Extensions can't set gestures for 4th and 5th mouse buttons (Back and Forward).
  • Unlike extensions that are limited by existing APIs, userChromeJS has unrestricted access to Firefox internals, so you can do almost whatever you want if you write code for that.

Download link - extract it in chrome folder.

multifoxContainer

When Firefox introduced containers, I created this script to get some features that I missed from Multifox, the legacy addon that implemented "containers" years before Firefox having this feature by default. Since then, Firefox has added some things this script had, so I removed them. But I still use it for two things:

  • New tabs (Ctrl+T or New Tab button) inherit the container of current tab (except for Private Tabs).

  • The label in urlbar serves as menubutton to reopen current tab in other container. With left click, current tab is replaced. With middleclick, a new tab opens without closing the other one.

Download link.

Open in Unloaded Tab Creates an item in contextmenu to open links/bookmarks/history in unloaded tabs, i.e. the tab is created, but it will only load when selected. Just like unloaded tabs when you start Firefox recovering tabs from previous usage. So you can, for example, open multiple related YouTube videos and load them one by one. Or open an entire bookmark folder in tabs without freezing the browser, since tab content will load on demand.

[Downloa

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

Highlights

  • •utils → I'm only interested in scripts
  • •utils → I'm only interested in extensions
  • •utils → I'm interested in both scripts and extensions
  • •Disables autoinstall updates for every addon.
  • •You can fill ignoreList if you are deliberately using an outdated version of an extension and don't want to be notified that an update is available.
  • •<i>Left-click</i> to minimize (so I can't close it accidentally).
  • •<i>Right-click</i> to close.
  • •<i>Middleclick</i> restores to fixed position/size (edit script code with your preferred values). If you want to restore to previous position/size, use <i>Shift + Middleclick</i>.
  • •<b>Hold right-click, then roll mouse wheel up or down</b> to switch to next/previous tab.
  • •<b>Hold right-click, then left-click</b> to switch to the last selected tab.

> Tags

JavaScriptfirefoxfirefox-addonfirefox-extensionfirefox-extensions

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言