-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox Nightly remove support for JSM - All scripts not working #335
Comments
userChrome.jsm => userChrome.js | 12 +++++++-----
xPref.jsm => xPref.sys.mjs | 4 ++--
2 files changed, 9 insertions(+), 7 deletions(-)
rename userChrome.jsm => userChrome.js (94%)
rename xPref.jsm => xPref.sys.mjs (94%)
diff --git a/userChrome.jsm b/userChrome.js
similarity index 94%
rename from userChrome.jsm
rename to userChrome.js
index 17a9224..759fb20 100644
--- a/userChrome.jsm
+++ b/userChrome.js
@@ -1,8 +1,10 @@
-let EXPORTED_SYMBOLS = [];
+'use strict';
-const { xPref } = ChromeUtils.import('chrome://userchromejs/content/xPref.jsm');
-const { Management } = ChromeUtils.import('resource://gre/modules/Extension.jsm');
-const { AppConstants } = ChromeUtils.import('resource://gre/modules/AppConstants.jsm');
+ChromeUtils.defineESModuleGetters(this, {
+ xPref: 'chrome://userchromejs/content/xPref.sys.mjs',
+ Management: 'resource://gre/modules/Extension.sys.mjs',
+ AppConstants: 'resource://gre/modules/AppConstants.sys.mjs',
+});
let UC = {
webExts: new Map(),
@@ -95,7 +97,7 @@ let _uc = {
},
everLoaded: [],
-
+
loadScript: function (script, win) {
if (!script.regex.test(win.location.href) || (script.filename != this.ALWAYSEXECUTE && !script.isEnabled)) {
return;
diff --git a/xPref.jsm b/xPref.sys.mjs
similarity index 94%
rename from xPref.jsm
rename to xPref.sys.mjs
index 836b3df..aba56db 100644
--- a/xPref.jsm
+++ b/xPref.sys.mjs
@@ -1,6 +1,6 @@
-let EXPORTED_SYMBOLS = ['xPref'];
+'use strict';
-var xPref = {
+export const xPref = {
// Retorna o valor da preferência, seja qual for o tipo, mas não
// testei com tipos complexos como nsIFile, não sei como detectar
// uma preferência assim, na verdade nunca vi uma
--``` |
Brasileiro?
|
@onemen |
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. |
only when that happens. |
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 |
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. Fixed browser.newtab.url script: |
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. |
I use this code to save a string into a file: var ostream = Cc['@mozilla.org/network/file-output-stream;1'].createInstance(Ci.nsIFileOutputStream);
ostream.init(file, -1, -1, 0);
var istream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);
istream.setUTF8Data(content);
NetUtil.asyncCopy(istream, ostream, aCallback) For "NetUtil" I use this code: const { NetUtil } = ChromeUtils.import('resource://gre/modules/NetUtil.jsm'); but ChromeUtils.import don't work anymore, and 'resource://gre/modules/NetUtil.jsm' don't exist in FF136. Does anyone have any idea how to resolve this? OK, resolved: ChromeUtils.defineESModuleGetters(this, {
NetUtil: 'resource://gre/modules/NetUtil.sys.mjs'
}); |
TMP has been updated.. but it seems .css changes I made in UserStyles folder no longer work.. pretty sure that stuff worked with styloaix ...no longer the case? |
check in |
I got it working but it's not working how it used to be.. ie the .css files were in the 'UserStyles' folder that ones styloaix handled I think.. no idea seems a bunch of stuff on this doesn't work still ..css stuff I was using all got chucked into /chrome/userChrome.css and that works. |
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. |
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. |
If you've updated the chrome-utils.folder and config.js from here: 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. |
Thank you, and I wish you all good luck with the development of fixes. It's true, that Mozilla leadership is turning authoritarian, but I believe, that Firefox is still better than Chrome. |
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 removedThe text was updated successfully, but these errors were encountered: