MrOtherGuy / fx-autoconfig

Load custom javascript in browser context
Mozilla Public License 2.0
173 stars 11 forks source link

Question about newest boot.jsm #12

Closed Lepefe closed 2 years ago

Lepefe commented 2 years ago

Hi there, please a question related to your newest boot.jsm.

For long time I used your fx-autoconfig, but with a non-standard location for utils and resources folders (which both are inside my chrome/JS folder). In fact, long time ago you helped me, I made little changes in few files, and always everything worked like a charm, never had problems with my customized JS, utils and resources folder locations.

But the newest boot.jsm changed my situation, and my uc.js scripts are not working anymore. If I install your fx-autocong, keeping the standard location for JS, utils and resources folders... no problem, everything works. So, if I'm not wrong, it seems that my problem is related to my non-standard location for utils and resources folders, and your newest boot.jsm.

I tried to look for new folder paths inside your newest boot.jsm, and couldn't recognize what to change there. But I know nothing about your scripts, so really it doesn't matter what I do.

If I'm right, if path folders changed inside your newest boot.jsm, please I request your help, please tell me what to change inside your boot.jsm in order to keep my current folder location (chrome/JS, chrome/JS/utils and chrome/JS/resources).

Thank you

MrOtherGuy commented 2 years ago

I haven't changed anything I could think of to cause that. But it wouldn't really surprise me if something got messed up with that kind of unexpected folder structure.

The first thing I would test though would be to remove your Firefox startup-cache, maybe the issue is just with cached scripts.

MrOtherGuy commented 2 years ago

Another thing that comes to mind is that if you had changed folder structure, then I believe you must have changed utils/chrome.manifest too. So, if you now replaced yours with one from this repo then you need to redo what you had done previously.

Lepefe commented 2 years ago

Hey, thanks for your replay.

There is no startup cache problem, I clean this folder every time I do a fx-autoconfig change.

Also, there is no manifest confusions, I keep your repo fx-autoconfig in one firefox folder installation separated from my customized fx-autoconfig (which always is in another firefox folder installation). Two fx-autoconfig, two different firefox installations. After your newest boot.jsm, my js scripts only work with your repo fx-autoconfig.

Please allow me to share with you my customized config.js, and my chrome.manifest. These files worked for long time, never a problem, until your newest boot.jsm.

If my problem is a simple folder paths issue, then please I'll appreciate your help. But if it's something more hairy and complicated, then forget, I don't want to bother you, I'll change my customized folder location, and I'll keep your repo folder default locations.

Thanks

Lepefe commented 2 years ago

EDIT

@MrOtherGuy, I believe I found the problem. It's inside my pref\config-prefs.js file. I always removed these lines (because I always used firefox nightly):

// Sandbox needs to be disabled in release and Beta versions
pref("general.config.sandbox_enabled", false);

I never had a problem with this removal. Now after your newest boot.jsm, if I add these lines, everything works again. Hope the info will be useful for you.

Please close the issue if you want.

Thanks

MrOtherGuy commented 2 years ago

I see. Just to clarify, is the version that wasn't working for you using release or beta build of Firefox?

Lepefe commented 2 years ago

I only use and only do test always with newest firefox nightly. Everything now is working for me, using my customized folder locations. The only change I made was in my config-prefs.js, I added the original lines, and worked. But I'm not 100% sure this change made everything works, I'm still testing. I can't give you my final opinion now. But please give me some time, I will redo all my tests, I'll try to identify what exactly made everything works, and I'll be back to you with my results.

MrOtherGuy commented 2 years ago

For what it's worth, the current boot.jsm seems to work fine as far as I can tell with Firefox 99 with your folder structure. It just requires changes to utils/chrome.manifest as well as program/config.js just like in the files you linked.

Another thing that comes to mind that could possibly have changed is that if your custom script tries to use gBrowser at startup before gBrowser is available. Here the behavior actually did change; previously boot.jsm just "made it available" for scripts, but now boot.jsm doesn't do that anymore and scripts are expected to deal with it themselves. For example to wait until startup has finished before trying to access it.

Lepefe commented 2 years ago

You're right. It's not the config-prefs.js. But also, it's not something related to my js scripts.

Days ago when I changed the boot.jsm, nothing worked. I did lot of tests, nothing worked. My js scripts only worked when I installed your repo fx-autoconfig, keeping your repo default folder locations.

My first thought was paths changed in your boot.jsm. It was not. My scripts also can't be the problem, because they perfectly work with your repo fx-autoconfig. I thought it was your config-prefs.js. It was not.

And now, mysteriously lol, everything is working! It works even with my customized folder locations.

My only conclusion is, perhaps, it was the nightly version I tested the day you posted your newest boot.jsm. Perhaps something changed since days ago, nightly changed, and the new nightly version works with your fx-autoconfig and my customized folders. I don't know! lol

The point is that everything works. Sorry for taking your time. Thank you.