.fi

- How I fixed "Save as" dialog not opening on Pale Moon (Firefox).

How I fixed "Save as" dialog not opening on Pale Moon (Firefox).

Posted: 2023-12-05 14:36:56Edited: 2023-12-05 14:39:22
Chronological Date: 2023-12-05

For a long while I have had an issue with Pale Moon browser (which is based on the XUL platform, but is basically based on Mozilla Firefox.) on linux, where when downloading a file the "Save As..." dialog would not open, but only for some sites.

Looking around, I found some settings, like browser.download.lastDir which points to the last download directory and others, but nothing helped. But then I noticed browser.download.lastDir.savePerSite which means that firefox stores last download locations per site basis (which is actually a good feature).

Then I thought of looking at the browser console, there I saw this error from DownloadLastDir.jsm:

NS_ERROR_FILE_UNRECOGNIZED_PATH: Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIFile.initWithPath]

There was also another error related (which I did not manage to copy before fixing) that basically told that the lastDir was invalid!

So apparently it fails to open the dialog if the last dir path is not valid.

But then the question is, where are the values stored. With some searching around, I found that they are in content-prefs.sqlite

Opening that file with a SQL manager (while browser was not running), such as DB Browser for SQLite, I could see that it contained several tables, but the one we are interested in is the prefs table. In it are several preferences related to specific sites (each linked to the groups table by ID), including the download directories.

I could see that it contained several entries from the time this profile was used on Windows system, so I deleted all of the entries starting with windows style paths.

And what you know it fixed the issue and the "Save As..." dialog appears again!