Well, it’s a shame I cannot edit the OP anymore, as the problem turned out to be due to my attempt at using a single profile folder cross-platform, not necessarily due to update to Firefox 145. Although … maybe this update had something to do with this, since I’ve been using a single profile folder cross-platform since at least 2021, and I have not experienced this problem until now.
Anyways: the thing is, I have a PC, where I have a Windows 10 (NTFS) partition, Ubuntu 20.04 (ext3) partition, and a shared partition (FAT32) automounted on both systems; the shared partition has a FFProfiles folder, which contains my main Firefox profile directory; and the respective paths are:
- Windows:
D:\FFProfiles\MyFFProfile
- Linux:
/media/UserName/SharedFAT32/FFProfiles/MyFFProfile
Note that I first noticed the problem in Ubuntu, after having dual booted in Windows (and performing a Firefox update there); cannot recall if the Ubuntu Firefox update was before or after the Windows one.
So, first I tried the following, which did not really lead to a solution: I created a new empty Firefox profile, and only installed Cast Kodi there; then I wanted to compare differences in profile folder files between entries related to this addon. Here I noticed that there is a “Pin extension to toolbar” checkbox upon addon installation:
… which I could not remember from previously, so I thought it might have been the cause of my problems (maybe it was a new setting in about:config).
Looking at files that may have contained information about the newly installed addon, at this time, I thought only these two files are related:
MyFFProfile/extension-preferences.json; however it just contains this:
...
"castkodi@regseb.github.io":
{
"permissions":["internal:privateBrowsingAllowed","<all_urls>"],
"origins":["<all_urls>"],
"data_collection":[]
},
...
MyFFProfile/prefs.js; however it only seems to contain the list of addons that should appear on the toolbar (or rather, nav-bar - apparently the “Pin extension to toolbar” checkbox ends up being recorded here, if needed):
...
user_pref("browser.uiCustomization.state",
"{\"placements\":
{
\"widget-overflow-fixed-list\":[],
\"unified-extensions-area\":[...],
\"nav-bar\":[\"back-button\",...,\"castkodi_regseb_github_io-browser-action\",...],
\"toolbar-menubar\":[\"menubar-items\"],
\"TabsToolbar\":[\"firefox-view-button\",...,\"alltabs-button\"],
\"vertical-tabs\":[],
\"PersonalToolbar\":[\"import-button\",\"personal-bookmarks\"]
},
\"seen\":[\"developer-button\",...,\"castkodi_regseb_github_io-browser-action\",...],
\"dirtyAreaCache\":[\"nav-bar\",...,\"vertical-tabs\"],
\"currentVersion\":23,
\"newElementCount\":2
}");
...
Then, I thought, there must be some Firefox addons startup logs, which I could check out when I start my Firefox with the old/original profile; I found https://stackoverflow.com/questions/12893981/logging-to-console-from-firefox-extension :
From Firefox 31 onwards you can use the “Enable persistent logs” setting to prevent the Network Monitor from clearing the list on reload.
… now, you need to click the gear icon on the far right side for the option to appear.
This answer may have gone out of date again. On Firefox 128.0 I had to set “extensions.sdk.console.logLevel” to “all”, restart, use the Browser Console (not the standard Developer Console) and the new step is: at the top of the Browser Console window I had to change Browser Console Mode from Parent process only to Multiprocess. There is no longer a “Show Content Messages” option. Not sure if this applies to all plugins - this was for a Sidebar plugin.
Note that on Firefox 145, my extensions.logging.enabled remained at false; extensions.sdk.console.logLevel by default does not exist; my Browser Console Mode was still at “Parent process only”; and all I had to do was to enable “Persist Logs” via the gear icon of the Developer Tools Console; restart Firefox - and then find this in the Browser Console (not the standard Developer Console):
Error while loading 'jar:file:///D:/FFProfiles/MyFFProfile/extensions/castkodi@regseb.github.io.xpi!/manifest.json' (NS_ERROR_FAILURE) Extension.sys.mjs:1162:20
readJSON resource://gre/modules/Extension.sys.mjs:1162
onStopRequest resource://gre/modules/NetUtil.sys.mjs:124
1764842259495 addons.xpi WARN Exception running bootstrap method startup on castkodi@regseb.github.io: Error: Error while loading 'jar:file:///D:/FFProfiles/MyFFProfile/extensions/castkodi@regseb.github.io.xpi!/manifest.json' (NS_ERROR_FAILURE)(resource://gre/modules/Extension.sys.mjs:1162:20) JS Stack trace: readJSON/</<@Extension.sys.mjs:1162:20
onStopRequest@NetUtil.sys.mjs:124:18
Oh well: I see an error for a Windows path here - even though I’m running Firefox on Linux! So, it seems obvious that the difference in path format is the problem …
It turns out, the Firefox Profile folder was never intended to be fully cross-platform (which makes me wonder how was I able to use it for years in that manner, without experiencing this problem of disappearing addon toolbar buttons?!); for instance Are Firefox profiles platform independant? | Firefox Support Forum | Mozilla Support:
Not 100% compatible. Some preferences in the prefs.js file (basically files paths from what I have observed) and some files added by add-ons may not be entirely compatible.
Also It is easy to export the whole Firefox profile from Windows to Linux : r/firefox:
Get rid of the content-prefs.sqlite file from the windows import. Whether that would fix it, not sure yet.
Anyways, after some trial and error, I found that there are mixed paths in MyFFProfile/extensions.json:
$ grep -oP '"[^"]*MyFFProfile[^"]*"' /media/UserName/SharedFAT32/FFProfiles/MyFFProfile/extensions.json
...
"D:\\FFProfiles\\MyFFProfile\\extensions\\castkodi@regseb.github.io.xpi"
"jar:file:///D:/FFProfiles/MyFFProfile/extensions/castkodi@regseb.github.io.xpi!/"
...
"D:\\FFProfiles\\MyFFProfile\\extensions\\cliget@zaidabdulla.com.xpi"
"jar:file:///D:/FFProfiles/MyFFProfile/extensions/cliget@zaidabdulla.com.xpi!/"
...
… and that there are also mixed paths in the webext.sc.lz4 and addonStartup.json.lz4 cached Firefox profile files, which I identified by grepping like so:
$ grep -rl MyFFProfile /media/UserName/SharedFAT32/FFProfiles/MyFFProfile
/media/UserName/SharedFAT32/FFProfiles/MyFFProfile/sessionstore-logs/error-sessionrestore-1764232819809.txt
/media/UserName/SharedFAT32/FFProfiles/MyFFProfile/startupCache/urlCache.bin
/media/UserName/SharedFAT32/FFProfiles/MyFFProfile/startupCache/webext.sc.lz4
/media/UserName/SharedFAT32/FFProfiles/MyFFProfile/extensions.json
$ grep -ao '....D:....' /media/UserName/SharedFAT32/FFProfiles/MyFFProfile/addonStartup.json.lz4
:///D:/FFP
… and the fix was:
-
Close / shut down Firefox
-
Change the Windows paths in MyFFProfile/extensions.json to Linux ones - which I had to do in two passes:
$ sed -b -i'' 's!/D:/FFProfiles/!/media/UserName/SharedFAT32/FFProfiles/!g' /media/UserName/SharedFAT32/FFProfiles/MyFFProfile/extensions.json
$ sed -b -i'' 's!D:\\\\FFProfiles\\\\MyFFProfile\\\\extensions\\\\!/media/UserName/SharedFAT32/FFProfiles/MyFFProfile/extensions/!g' /media/UserName/SharedFAT32/FFProfiles/MyFFProfile/extensions.json
-
Delete the webext.sc.lz4 and addonStartup.json.lz4 cached Firefox profile files:
rm /media/UserName/SharedFAT32/FFProfiles/MyFFProfile/startupCache/webext.sc.lz4 /media/UserName/SharedFAT32/FFProfiles/MyFFProfile/addonStartup.json.lz4
-
Start Firefox again with the MyFFProfile profile
… and finally - my extension icons are back on the toolbar, and everything worksforme as before!
Well, I wish this was an easier problem to solve, and I did not have to waste all these hours to solve this …