MrOtherGuy / fx-autoconfig

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

getBoolPref unexpected error #41

Closed Laurens256 closed 1 year ago

Laurens256 commented 1 year ago

When using the writeFile function, something called getBoolPref gets called inside fs.sys.mjs (line 170). This results in the following error:

Uncaught (in promise) NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getBoolPref]

Enabling allowUnsafeWrites pref fixes this, but the file I passed to the writeFile function is inside my resources directory so this shouldn't be necessary. Removing this line and the if statement which checks for allowUnsafeWrites also fixes this code and everything works as expected. Problem is (I think) something with getBoolPref.

Thanks for the great product btw :)

Laurens256 commented 1 year ago

I found the problem was my about:config did not have a userChromeJS.allowUnsafeWrites key at all. Setting this key to either true or false fixed the issue. Might have been a mistake on my part, feel free to close if it was :)

MrOtherGuy commented 1 year ago

Thanks for reporting. This is definitely oversight on my part - it should not fail if the pref is missing. c8d08a8 should fix that.

Laurens256 commented 1 year ago

Thanks, this fixed it