Files
FreshRSS/p/scripts
Inverle 149136fbe2 Improve sharing via Print (#7728)
List of changes:
* The temporary document for printing is now in an `<iframe>` instead of a new tab
* The whole `<head>` element is copied to the temporary document, except for `<script>` tags to copy over the `<meta>` tags as well
* URLs that contain the instance base URL are now removed from the printed PDF
* The saved filename (PDF) will now default to the article title
* `<details>` is auto expanded
* Styling:
   * The main document's `<html>` class is copied over to preserve some styling that might use those classes
   * Instead of writing `content_el.innerHTML` to the temporary document, `content_el.outerHTML` is now written instead to apply the styles that select `.content`
   * `.dropdown-menu` is now hidden in the printed document, because it can't be expanded anyway
   * Headers and footers are hidden in the printed document
* The printed document will now display correctly all the time, by waiting for it to load before calling `print()`
   * Before, the stylesheets might've not finished loading and the document was broken
* Better browser support on mobile for this feature
   * Before, the document would fail to print on Chrome Mobile
   
Tested on:
* Firefox - both desktop and mobile, works 
* Chrome - both desktop and mobile, works 
* Opera - desktop, works (same as Chrome) 
* Brave - both desktop and mobile (same as Chrome), works 
* Safari - both desktop and mobile, works
* Microsoft Edge - both desktop and mobile, works 
* GNOME Web - desktop, works 
* SeaMonkey - desktop, works 

Known issues:
* Images may not finish loading the first time the print dialog is opened

TODO:
* [x] Test on Safari
* [x] Try to fix GNOME Web
2025-08-06 21:49:13 +02:00
..
2021-10-21 11:44:03 +02:00
2022-07-17 22:54:24 +02:00
2025-08-06 21:49:13 +02:00
2022-05-15 21:52:52 +02:00