Fix AddonManager/FileUtils imports #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The script has stopped working ever since I updated Firefox Developer Edition from v135.0 to 136.0a2
The error in the browser console was "Components.utils.import is not a function"
An alternative way to import AddonManager and FileUtils is with ChromeUtils.importESModule, and by specifying the filename of the module .mjs file found here: https://searchfox.org/mozilla-central/source/toolkit/modules
Also, the import for FileUtils needs to be hoisted out of the try block as otherwise the browser errors that FileUtils isn't defined (not sure why this didn't error before I updated)
If this PR is merged along with #3 then the script works again (at least for me)
Also this script has been really helpful for my setup. Thanks for releasing it!