1
8
There weren't any straightforward guides when I looked this up, and I even had to ask myself. But I just needed to put so and so together, get some feedback here, and voila! Hopefully this can work for you too, and could edit userchrome.css in your favorite editor, and see the changes in Firefox immediately. I tested that it works with
@import url("folder/file.css");, and nested imports too (iffolder/file.csscontained@import url("Another folder/file.css");.
- Install fx-autoconfig (I haven't tested it with other Firefox JS loaders), following the whole install section: https://github.com/MrOtherGuy/fx-autoconfig?tab=readme-ov-file#install
- In the chrome/JS/ folder, create
<any file name>.uc.mjs(I named minerefresh.uc.mjs) and paste the script below (it's slightly modified from this snippet): * The part containing@onlyonceis needed so fx-autoconfig loads it just once, rather than spawn a new instance of the script every time a new firefox window is opened.- Clear startup cache: https://github.com/MrOtherGuy/fx-autoconfig?tab=readme-ov-file#deleting-startup-cache
- You may need to toggle the script. You can go to Menu Bar > Tools > userScripts.
Script
// ==UserScript== // @onlyonce // ==/UserScript== // Script from here: https://gist.github.com/jscher2000/ad268422c3187dbcbc0d15216a3a8060?permalink_comment_id=3259657#gistcomment-3259657 setInterval(() => { /* Code to paste and run in the Browser Console Requires devtools.chrome.enabled => true in about:config Tested in Firefox 68.0.1 on Windows */ // Create references to APIs we'll use var ss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService); var io = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); var ds = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties); // Get the chrome directory in the current profile var chromepath = ds.get("UChrm", Ci.nsIFile); // Specific file: userChrome.css or userContent.css chromepath.append("userChrome.css"); // Morph to a file URI var chromefile = io.newFileURI(chromepath); // Unregister the sheet if(ss.sheetRegistered(chromefile, ss.USER_SHEET)){ ss.unregisterSheet(chromefile, ss.USER_SHEET); } // Reload the sheet ss.loadAndRegisterSheet(chromefile, ss.USER_SHEET); }, 1000)



