- Notifications
You must be signed in to change notification settings - Fork16
**Stops working with FF v72.** Firefox Quantum-compatible custom javascript in browser context — no extension, userChromeJS replacement.
License
nuchi/firefox-quantum-userchromejs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
It's very possible that at some future time the Firefox team will remove some or all of the functionality that makes this possible, so enjoy it while you can.
Now that the Firefox team has removed XBL from Firefox starting with version 72, this trick no longer works. It was a good run while it lasted!
See the Bugzilla tracking pageDisable MOZ_XBL in Firefox.
Extensions that allow you to run arbitrary javascript in your browser context don't work anymore with Firefox 57 and later. This is a workaround which allows you to run arbitrary javascript in your browser context, as used to be enabled by the extensionuserChromeJS.
It does not involve adding any extensions, and instead works only by adding (or changing) files in your Firefox user profile.
After I made this I learned of something calledautoconfig.js
which apparently serves a similar purpose; I haven't investigated it very much.
Place the threeuserChrome.*
files in a/chrome
directoryinside your Firefox profile. If you already have auserChrome.css
file, you may instead add the contents of the file here anywhere in your existing file.
Replace the contents ofuserChrome.js
with whatever you wish; it will execute in the browser context whenever you open a new browser window. The existing contents of that script (in this repo) are a small change to the fullscreen behavior of Firefox under macOS: it restores the pre-Lion behavior (and hides the toolbar and tabs when in fullscreen mode).
To uninstall, remove the three files. If you have other content in theuserChrome.css
file you can remove just the part that you added during installation.
I wanted to enable pre-Lion osx fullscreen mode, and couldn't find an easy way to do it in Firefox Quantum. It's possible with unpacking, altering, and repacking files in theFirefox.app
package... but that's painful and might not survive updates. Then I came upon this method, realized this trick was far more general than just altering fullscreen mode, and factored it out so that the javascript part was easily modifiable by anyone.
It relies on the fact that post-57 Firefox still allows a customuserChrome.css
file, and a Firefox-specific CSS hack which can bind javascript to arbitrary DOM elements. I picked (somewhat at random) a DOM element in the browser whose existing XBL binding didn't already have a<constructor>
tag, and added some JS there to load an external javascript file.
It's very possible that at some future time the Firefox team will remove some or all of the functionality that makes this possible, so enjoy it while you can.
About
**Stops working with FF v72.** Firefox Quantum-compatible custom javascript in browser context — no extension, userChromeJS replacement.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.