MrOtherGuy / fx-autoconfig

Load custom javascript in browser context
Mozilla Public License 2.0
164 stars 10 forks source link

Can't disable module scripts #43

Closed aminomancer closed 10 months ago

aminomancer commented 10 months ago

https://github.com/MrOtherGuy/fx-autoconfig/blob/629c80f0afe3efe5f5d19d5a06b24fb08d227f7a/profile/chrome/utils/boot.sys.mjs#L392-L410

The disabled scripts pref is only checked before injection for window scripts, so ESM scripts get registered and imported even if disabled. Well, window ESM scripts are fine since they have the disabled check before ScriptData.tryLoadScriptIntoWindow. It's just the background modules.

Btw, I'm pretty sure this is a regression, since I had a script disabled for several months due to a memory leak, so if it wasn't working it would have been really noticeable. I think it's one of the recent updates where I started noticing it again.

MrOtherGuy commented 10 months ago

Umm - there actually was a problem here not long ago - but now it should work fine. That registerScript() call returns true/false indicating if the script is disabled so that then fall into the continue branch.

Or am I missing something?

aminomancer commented 10 months ago

🤦‍♀️ no you're right lol. I just didn't have the latest version and thought it looked identical to what I had. Forgot you have version numbers now

MrOtherGuy commented 10 months ago

Okay, cool. I stumbled on the original issue literally by accident when looking for something else in the code and was like man, how has nobody noticed this? So now I was worried if I had simultaneously missed something else equally obvious :p

aminomancer commented 10 months ago

Hahaha I thought the same thing. Really weird that it took so long to spot