firefox-scripts icon indicating copy to clipboard operation
firefox-scripts copied to clipboard

Preparation for Firefox 117

Open onemen opened this issue 2 years ago • 113 comments

@xiaoxiaoflood

Firefox 117 changes

firefox-scripts will stop working on Firefox 117 without these changes

Update utils

BootstrapLoader.jsm

 let EXPORTED_SYMBOLS = [];

 const { XPCOMUtils } = ChromeUtils.import('resource://gre/modules/XPCOMUtils.jsm');
+const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;

 XPCOMUtils.defineLazyModuleGetters(this, {
   Blocklist: 'resource://gre/modules/Blocklist.jsm',
   ConsoleAPI: 'resource://gre/modules/Console.jsm',
   InstallRDF: 'chrome://userchromejs/content/RDFManifestConverter.jsm',
-  Services: 'resource://gre/modules/Services.jsm',
 });

 Services.obs.addObserver(doc => {

RDFDataSource.jsm

 var EXPORTED_SYMBOLS = ["RDFLiteral", "RDFBlankNode", "RDFResource", "RDFDataSource"];

 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;

 XPCOMUtils.defineLazyGlobalGetters(this, ["DOMParser", "Element", "fetch"]);

-ChromeUtils.defineModuleGetter(this, "Services",
-                               "resource://gre/modules/Services.jsm");
-
 function isElement(obj) {
   return Element.isInstance(obj);
 }

userChrome.jsm

 let EXPORTED_SYMBOLS = [];

-const { Services } = ChromeUtils.import('resource://gre/modules/Services.jsm');
+const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
 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');

xPref.jsm

 let EXPORTED_SYMBOLS = ['xPref'];

-const {Services} = ChromeUtils.import('resource://gre/modules/Services.jsm');
+const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;

 var xPref = {
   // Retorna o valor da preferência, seja qual for o tipo, mas não

onemen avatar Jul 11 '23 06:07 onemen

@onemen @xiaoxiaoflood is lost contact for so long may be consider put all these in a fork?

117649 avatar Jul 11 '23 09:07 117649

maybe @xiaoxiaoflood can update us about what are the plans for this repository

onemen avatar Jul 11 '23 11:07 onemen

Last commit by xiaoxiaoflood was made on February 25, 2023 (4.5 months ago), so it is unlikely, that he will make any change.

Aleksandra0056 avatar Jul 11 '23 12:07 Aleksandra0056

maybe @xiaoxiaoflood can update us about what are the plans for this repository

Last commit by xiaoxiaoflood was made on February 25, 2023 (4.5 months ago), so it is unlikely, that he will make any change.

Make a pr so if @xiaoxiaoflood showed up again he can accept it?

117649 avatar Jul 11 '23 12:07 117649

I don't know what happened to xiaoxiaoflood, but maybe he lost his password, or maybe someone hacked him account, or maybe he had an accident.

If one of these theories are true, then he didn't show up again, but onemen should decide what to do, if he forks this repository or if he makes a Pull Request.

Aleksandra0056 avatar Jul 11 '23 12:07 Aleksandra0056

And only extensions stop work? Or also scripts (like status bar, or extensions options menu) stop work from Firefox 117.0?

Aleksandra0056 avatar Jul 11 '23 12:07 Aleksandra0056

Yeah, he used to respond fairly quickly. I honestly use only a couple of the add-ons. I'm wondering if I just uninstall this... it's just too complicated to maintain this on top of all the other FF customizations.

Does FF 117 automatically make things go back to default or do I have to do anything else? I might just leave it be and remove the addons and scripts if it doesn't break anything to do so.

megamorphg avatar Jul 11 '23 13:07 megamorphg

So, I think, that forking this repository would be the best idea if xiaoxiaoflood is not responding. If I'll update to Firefox 117.0 then I will change my JS files in chrome directory to use actual code as onemen wrote, other people should do the same.

Aleksandra0056 avatar Jul 11 '23 14:07 Aleksandra0056

Thanks for this, it probably explains why I'm suddenly having context menu problems with DTA in 117.

xiaoxiaoflood is still around, he posts at Reddit as tustamido:

https://old.reddit.com/user/tustamido

marty60 avatar Jul 11 '23 16:07 marty60

Firefox 117 is now on Nightly, until it reach production we will figure out what to do.

onemen avatar Jul 11 '23 17:07 onemen

Thanks for this, it probably explains why I'm suddenly having context menu problems with DTA in 117.

xiaoxiaoflood is still around, he posts at Reddit as tustamido:

https://old.reddit.com/user/tustamido

Hoping you're not mismatching accounts of different person.

117649 avatar Jul 11 '23 18:07 117649

Hoping you're not mismatching accounts of different person.

This is the thread I got the name from:

https://old.reddit.com/r/XUL_for_Quantum_Dev/comments/fs76ff/little_update_current_fx_version_75/

marty60 avatar Jul 11 '23 18:07 marty60

This whole thing is a mess now. Removing that one line from config.js breaks the custom buttons addon so I can't do anything with that since CB is a must have.

Even with all of the changes the two scripts I have still don't work and that's probably due to updates that need to be made with the scripts.

In addition, keyconfig and DTA are dead, also must haves. Might as well stay with an earlier nightly for the time being until everything can be sorted out. Hopefully xiaoxiaoflood returns since he's usually been good with this project.

marty60 avatar Jul 11 '23 19:07 marty60

@marty60,

you probably need to fix +const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services for all scripts that use Services

onemen avatar Jul 11 '23 20:07 onemen

you probably need to fix +const Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services for all scripts that use Services

Thanks for that but tried and still didn't work. It's a script by Aris that makes the forward button moveable so I can visit him and he'll probably give me an update.

marty60 avatar Jul 11 '23 20:07 marty60

Yesterday seemed dire but today's nightly everything returned except for keyconfig. DTA is still functional. I was able to fix Aris's script by simply removing this line:

var {Services} = Components.utils.import("resource://gre/modules/Services.jsm", {});

The only caveat is if I delete the line from config.js everything breaks so keeping it in seems to be the fix, at least for me since custom buttons apparently needs it and it's not breaking the scripts.

Any chance at taking a look at keyconfig? I don't know about any of the other extensions.

marty60 avatar Jul 12 '23 14:07 marty60

For anyone using Password Manager open passwordManager.js with Wordpad and delete these lines:

/* eslint-disable-next-line no-var */ var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");

marty60 avatar Jul 12 '23 16:07 marty60

Getting keyconfig to work again was actually pretty easy. You just need to go through these files and delete these lines:

Bootstrap.js: Components.utils.import("resource://gre/modules/Services.jsm");

defaultPreferencesLoader.jsm: const { utils: Cu, classes: Cc, interfaces: Ci } = Components; Cu.import('resource://gre/modules/Services.jsm');

edit.xhtml: var {Services} = ChromeUtils.import('resource://gre/modules/Services.jsm');

Keyconfig.js: var {Services} = ChromeUtils.import('resource://gre/modules/Services.jsm');

ChromeManifest.jsm: Components.utils.import("resource://gre/modules/Services.jsm");

Overlays.jsm: ChromeUtils.defineModuleGetter( this, "Services", "resource://gre/modules/Services.jsm" );

If you start Firefox and it’s not showing in Tools going into about:addons disabling then re-enabling it should bring it back. Might have to reboot it a few times and clean out the error log.

marty60 avatar Jul 12 '23 20:07 marty60

What is keyconfig?

Aleksandra0056 avatar Jul 14 '23 16:07 Aleksandra0056

What is keyconfig?

It's one of xiaoxiaoflood's revised addons:

https://github.com/xiaoxiaoflood/firefox-scripts/tree/master/extensions

It's been around forever, it was originally developed by dorando and let's you easily re-map keyboard shortcuts. It's been a must have for me since the firefox 3.6 days.

marty60 avatar Jul 14 '23 18:07 marty60

What is keyconfig?

It's one of xiaoxiaoflood's revised addons:

master/extensions

It's been around forever, it was originally developed by dorando and let's you easily re-map keyboard shortcuts. It's been a must have for me since the firefox 3.6 days.

You can try this script for temporary usage

benzBrake avatar Jul 15 '23 01:07 benzBrake

Yesterday seemed dire but today's nightly everything returned except for keyconfig.

@marty60 What returned? You mean, that extensions are working again? Or also scripts are working again? You wrote it unclearly.

Aleksandra0056 avatar Jul 15 '23 07:07 Aleksandra0056

@marty60 What returned? You mean, that extensions are working again? Or also scripts are working again? You wrote it unclearly.

After making the changes to the files in the utils folder that onemen posted but leaving that line in config.js the scripts are working (I had to manually fix one of them). DTA is also working. Keyconfig had to be manually updated, the changes to the files were posted above.

At least for me, everything is back to normal. If you're having a problem with any scripts or addons post it and maybe someone can help.

marty60 avatar Jul 15 '23 12:07 marty60

You can try this script for temporary usage

@benzBrake I've got keyconfig updated to load again in 117.0 but how does your script work? I tried using it but am getting an error. If it does what keyconfig can it would make a useful backup.

marty60 avatar Jul 15 '23 12:07 marty60

You can try this script for temporary usage

@benzBrake I've got keyconfig updated to load again in 117.0 but how does your script work? I tried using it but am getting an error. If it does what keyconfig can it would make a useful backup.

I have add a English Version of Readme. What's the error message?

benzBrake avatar Jul 16 '23 13:07 benzBrake

So, someone should contact xiaoxiaoflood here https://www.reddit.com/user/tustamido if it is his reddit account.

Aleksandra0056 avatar Jul 16 '23 13:07 Aleksandra0056

I have add a English Version of Readme. What's the error message?

Actually getting two error messages, one at startup and then another load error after clicking that. It's also generating a file in userChrome called _keychanger.js.

What exactly does this script do and how does it work? Does it do the same thing as keyconfig?

load error.zip

marty60 avatar Jul 16 '23 15:07 marty60

I have add a English Version of Readme. What's the error message?

Actually getting two error messages, one at startup and then another load error after clicking that. It's also generating a file in userChrome called _keychanger.js.

What exactly does this script do and how does it work? Does it do the same thing as keyconfig?

load error.zip

The first message is to let you click and then automatically create a configuration file _keychanger.js. The second message is that the configuration file is empty.

Here is a reference configuration file: https://github.com/benzBrake/FirefoxCustomize/blob/master/userChromeJS/KeyChanger/_keychanger.js

benzBrake avatar Jul 17 '23 00:07 benzBrake

Ok I see how it works and this is why Firefox is the best browser hands down. I was able to get everyone of the keyconfig codes and re-mapping I use in the addon with your script. Nice job.

_keychanger.zip

marty60 avatar Jul 17 '23 04:07 marty60

Any chance for someone to upload a zip with the needed edited files?

Thank you.

rosgr100 avatar Jul 19 '23 15:07 rosgr100