firefox-scripts: Firefox Nightly remove support for JSM - All scripts not working

Bug 1881888 - Remove support for JSMs landed in Firefox Nightly 136 on 2025-01-25

[userChrome.jsm](https://github.com/xiaoxiaoflood/firefox-scripts/blob/master/chrome/utils /userChrome.jsm) hookFunction.jsm xPref.jsm

stop working

Also config.js need update since ChromeUtils.import was removed

try {
  ChromeUtils.import('chrome://userchromejs/content/userChrome.jsm');
} catch (ex) {};

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 24

Most upvoted comments

@marty60

Any chance someone could upload the updated files?

I tried to update the files according to onemen’s changes, but I still need to update the config.js file to make it work and I don’t know how to do that. Also, even if the autoconfig is fixed, it would be necessary to refactor all the scripts since they removed several functions used by the scripts. Unless someone takes care of updating the scripts since @xiaoxiaoflood is missing, it seems to me that this is the end of the scripts and the repository.

config.js update:

try {
-  ChromeUtils.import('chrome://userchromejs/content/userChrome.jsm');
+  Services.scriptloader.loadSubScript('chrome://userchromejs/content/userChrome.js'); 
} catch (ex) {};

I will try to create a fork to this repository after i finish to update Tab mix Plus

@onemen,

try {

  • ChromeUtils.import(‘chrome://userchromejs/content/userChrome.jsm’);
  • Services.scriptloader.loadSubScript(‘chrome://userchromejs/content/userChrome.js’); } catch (ex) {};

Thanks everyone for the response. The config.js was the problem but this fixed it so now I’ve got it working again. The files have been uploaded.

Unfortunately three of my addons: keyconfig, saved passwords, and dta are broke and will need to be updated as well so still got some work to do.

chrome-utils folder.zip

autoconfig.zip

Fixed browser.newtab.url script:

newtab-aboutconfig.uc.zip

@marty60

Any chance someone could upload the updated files?

I tried to update the files according to onemen’s changes, but I still need to update the config.js file to make it work and I don’t know how to do that. Also, even if the autoconfig is fixed, it would be necessary to refactor all the scripts since they removed several functions used by the scripts. Unless someone takes care of updating the scripts since @xiaoxiaoflood is missing, it seems to me that this is the end of the scripts and the repository.

@fxzzi

setting a new tab page also seems to be broken. I used to do it minimally like so:

Use this instead:

let { AboutNewTab } = ChromeUtils.importESModule("resource:///modules/AboutNewTab.sys.mjs");
AboutNewTab.newTabURL = "file:///home/faaris/.local/share/startpage/fazzi/index.html";

All old .jsm file replaced with .sys.mjs file, from now on use only ChromeUtils.importESModule or ChromeUtils.defineESModuleGetters if you want lazy import

ChromeUtils.defineESModuleGetters(lazy, {
  AboutNewTab: "resource:///modules/AboutNewTab.sys.mjs",
});

@Aleksandra0056,

If you’ve updated the chrome-utils.folder and config.js from here:

https://github.com/xiaoxiaoflood/firefox-scripts/issues/343

then from about:config try toggling “security.browser_xhtml_csp.enabled” to false. If the only update needed for the script is event handlers then it should work again in 136+.

As has been posted several times it’s only a temporary fix as Mozilla plans to remove that pref in the future but it will buy some time until the scripts can be properly updated.

How can I fix this issue entirely? I can’t run any of my scripts. Can someone develop the damn fix for all files? It’s the year 2025 and not 1930. Technological sufficiency should be enough for a universal fix for all files to be developable for these simple programs/apps.

I can’t find any updated files in the comments (except those in chrome-utils.folder.zip).

Firefox Scripts is constantly breaking. CustomJSforFx has not working at all since update 136.0.

By the way, what is happening to humanity? Everything has been breaking in the last decade. Even I was frustrated today because my PC is constantly suddenly shutting down, and restarting it isn’t working. My laptop completely broke. My sound tuner broke.

The entire world is upside down. I apologise for speaking off-topic, but it’s truth.

In order for the legacy addons to install and work won’t BootstrapLoader.jsm and other files in the utils folder have to be updated? Even when trying to fix addons I’m getting an error that the addon appears corrupt when attempting to install it.

They were done. BootstrapLoader.jsm isn’t a module script in fact.

Stop twisting things around, I asked a question with the hope of getting an answer.

My apologies if I misunderstood but your posts made it appear as though the removal of autoconfig.js was inevitable. Good to know it isn’t.