MozArchiver on Linux, problem with file names...

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
P_A_Semi
Hobby Astronomer
Hobby Astronomer
Posts: 24
Joined: 2023-07-12, 00:14

MozArchiver on Linux, problem with file names...

Post by P_A_Semi » 2026-01-20, 22:30

When saving pages with Ctrl+S, using MozArchiver (latest version 2.0.1, PM 33.9.1), "Web Archive, MHTML" is selected in file-dialog on Linux (openSUSE) - it always offers .html file extension, instead of .mht, as it works on Windows... (extension .mht is added and saved as file.html.mht ... better than saving MHT into file.html but suboptimal...)

Also, when saving to NTFS partition under Linux, same file-name restrictions as in Windows apply - no special characters ":/\?*<>|" in file names, while : (colon) is very common in titles... (I'm not sure if offering wrong Filename from <title> for Ctrl+S is problem of MozArchiver or Palemoon itself? Saving mht to bad filename just silently fails...)
Also while saving files on Linux, I'd like to copy it to FAT32 flash-disk and transfer to Windows without problems with file-names...
Can there be an option (about:config) for safeFileNames ?

-----

I also formerly patched my version of MozArchiver to log into Browser Console, that it succesfully saved the file:
in extensions\mozarchiver@lootyhoof-pm.xpi\chrome\content\engine\MhtmlArchivePage.js
at end of file in _writeArchive :

Code: Select all

    try{
      let { console } = Cu.import("resource://gre/modules/Console.jsm", {});
      let fi = this.archive.file;
      console.log('Saved '+(fi.leafName||fi.name));
    }catch(x){}
I consider it a useful feature that could be added to options?
(Because saving often writes in Downloads popup on green arrow-down button, that it "failed", but continues saving and saves it well, maybe depending on pages containing non-existent frames or I do not know why, and also when I close the tab too soon (as saving a page may take very long - especially if I aborted loading the page images with Escape, but saving is fetching them all, and I usually save it just before closing it...), but I'm now used to check browser console to see, that I may close the tab, that the file is already saved...)

-----

Does it really have to save all images, even if their parent element is hidden by css class and display:none and there is no javascript in MHT to ever display it ?
(Having them instead sanitized with urn:not-loaded: would make no difference on displayed output and would not crash saving on 32-bit system...)

Consider this poisonous article - there are 1286 images in section "all other articles by this author", that is hidden by toggle...
(Beware that it polutes the cache by that many useless images! If you right-click to download it without displaying in PM and inspect it in text editor, there is multitude of <dd class="typeCont"> , their parent is hidden by class=collapse ( id="clankyAutora" ) leading to display:none in css file... but simply asking img.offsetWidth getting null could trigger inspecting, whether the parents have display:none and in that case avoid saving the image and instead sanitize it with urn:not-loaded: ...? )

(In my 32-bit version saving that to MHTML, it soon has status "failed" in downloads, so that it cannot be aborted, but it keeps fetching 1000 images (visible in Browser Console) until it fails with "out of memory" error...)

(I repeatedly tried to convince the author that it is reckless to have over 1000 vain images on each page... But there are other similar cases, even page with over 3000 images can be seen...)

πα½

User avatar
Veit Kannegieser
Moonbather
Moonbather
Posts: 65
Joined: 2019-03-23, 19:16

Re: MozArchiver on Linux, problem with file names...

Post by Veit Kannegieser » 2026-01-20, 23:18

P_A_Semi wrote:
2026-01-20, 22:30
no special characters ":/\?*<>|" in file names, while : (colon) is very common in titles
You may want to try the windows_names mount option for ntfs, at least that helps for normal Pale Moon file creation use.

User avatar
P_A_Semi
Hobby Astronomer
Hobby Astronomer
Posts: 24
Joined: 2023-07-12, 00:14

Re: MozArchiver on Linux, problem with file names...

Post by P_A_Semi » 2026-01-21, 16:10

Veit Kannegieser wrote:
2026-01-20, 23:18
You may want to try the windows_names mount option for ntfs, at least that helps for normal Pale Moon file creation use
Now I'm playing a "clicking user" and the disk was mounted by a mouse-click (and password)...
It is a general issue - as a user I may want to have all file-names compatible with flash-disk, where I will copy the files later... PM cannot guess that at the moment of offering the file-name in "Save as" dialog...
(the option could also be named "compatible filenames"...)

Also having a | pipe or < > in file-names is potentialy insecure as the user may later forget to quote it properly...

πα½