Added 2
- Added the %switch<value|case1|result1|case2|result2|...|default> function in the filename template, which returns the result matching the value or the default when no case matches
- Documented the %switch function on the help page
Changed 3
- The script embedded in annotated pages to display, move, resize and collapse notes is now built from single-file-core (single-file-notes.js) and minified instead of being generated from the editor source
- Pages using many web fonts are processed faster when the option to remove alternative fonts to the ones displayed is enabled, by caching the parsed src lists and font details
- Updated single-file-core to 1.12.0
Fixed 13
- A page auto-saved on unload from a closing tab is saved again instead of failing and staying in the pending saves with the processing status
- The first auto-save of a browser session is removed from the pending saves once the page has been saved, since task id 0 was misread as no task
- Auto-save entries of pages that left without sending their content are removed when the tab is closed, displays another page, or does not answer
- The unload listener of the auto-save is registered as soon as the options are received instead of on DOMContentLoaded
- A page left before being saved is no longer lost when auto-save after page load or on page unload and auto-save on tab removed are both enabled
- Closing the tab no longer saves the page twice when auto-save on page unload and auto-save on tab removed are both enabled
- Hiding a tab with auto-save on tab discard enabled no longer leaves the data-single-file marker attributes in the page
- The capture kept for a hidden tab is released when the tab is closed, and a tab discarded before its capture is received is saved
- In pages saved with notes, releasing the mouse after resizing or moving a note no longer leaves the note following the pointer; pages already saved must be opened in the editor and saved again to get the fixed script
- In the editor, removing the selected note no longer keeps it as the selected note, adding a note selects it, and the anchor of a note is no longer looked for in the notes or masks
- With the Deferred content option set to keep the zoom level, the sizes and positions reported to the page are scaled like the page so pages laying out content from them are saved whole
- The skip the save if the file exists option only applies to files saved in the download folder, so saves to the annotation editor, clipboard and companion are no longer cancelled by a same-named file in the download history
- A skipped save no longer opens the saved page nor requests a proof of existence
From SingleFile
Changes
- Added the
%switch<value|case1|result1|case2|result2|...|default>function in the filename template: it comparesvaluewith each case and returns the matching result, ordefaultwhen no case matches, e.g.%switch<{url-hostname-domain}|bbc|BBC|imdb|IMDb|%capitalize<{url-hostname-domain}>>; the help page documents it (#2052) - The script embedded in annotated pages to display, move, resize and collapse the notes is now built from single-file-core (
single-file-notes.js) and minified, instead of being generated from the source of the editor - Pages using many web fonts are processed faster when the option "remove alternative fonts to the ones displayed" is enabled: the parsed
srclists and the font details are cached (gildas-lormeau/single-file-core#12)
Fixes
- A page auto-saved on unload from a tab being closed is saved again: the content was received without the tab of the sender, the save failed and its entry stayed in the pending saves with the "processing" status (#2053)
- The first auto-save of a browser session is removed from the pending saves when the page has been saved (the task id
0was read as "no task"), and the auto-save entries of pages that went away without sending their content are removed when the tab is closed, displays another page, or does not answer (#2053) - The unload listener of the auto-save is registered as soon as the options are received instead of on
DOMContentLoaded - With "auto-save after page load or on page unload" and "auto-save on tab removed" both enabled, a page left before being saved is no longer lost; with "auto-save on page unload" and "auto-save on tab removed" both enabled, closing the tab no longer saves the page twice
- With "auto-save on tab discard" enabled, hiding a tab no longer leaves the
data-single-file-*marker attributes of the capture in the page, the capture kept for a hidden tab is released when the tab is closed, and a tab discarded before its capture is received is saved - In pages saved with notes, releasing the mouse after resizing or moving a note no longer leaves the note following the pointer: the embedded script referenced a function that only exists in the editor (#2054, regression from 2023; the pages already saved must be opened in the editor and saved again to get the fixed script)
- In the editor, removing the selected note no longer keeps it as the selected note, adding a note selects it, and the anchor of a note is no longer looked for in the notes or in the masks
- With "Deferred content > keep the zoom level", the sizes and positions reported to the page are scaled like the page, so pages that lay out their content from them are saved whole (#1919)
- The option "skip the save if the file exists" only applies to the files saved in the download folder: saves to the annotation editor, the clipboard and the companion are no longer cancelled by a file of the same name in the download history, and a skipped save no longer opens the saved page nor requests a proof of existence
- Updated single-file-core to 1.12.0