How to effectively save a page after having converted it using reader-viewer?
I used Firefox 61.0.1 on Linux Mint.
Firefox's reader viewer removes clutter from web pages. It works fine online, but save pages come out blank offline. if you open with a text a editor, you can see they contain the text.
Is there a way to fix this?
Screenshots:
Saved original page displayed in browser; Saved reader-viewer page displayed in browser; The files with their size.
Truncated content of the saved html page with reader-viewer:
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; img-src *; media-src *"> <meta content="text/html; charset=UTF-8" http-equiv="content-type"> <meta name="viewport" content="width=device-width; user-scalable=0"> <link rel="stylesheet" href="List%20of%20compositions%20by%20Johann%20Sebastian%20Bach_files/aboutReader.css" type="text/css"> <script type="text/javascript" src="List%20of%20compositions%20by%20Johann%20Sebastian%20Bach_files/aboutReader.js"></script> <link rel="stylesheet" href="List%20of%20compositions%20by%20Johann%20Sebastian%20Bach_files/narrate.css"><title>List of compositions by Johann Sebastian Bach</title><link rel="shortcut icon" href="https://en.wikipedia.org/static/favicon/wikipedia.ico">
List of compositions by Johann Sebastian Bach
1724-04-30
Cantata Weinen, Klagen, Sorgen, Zagen (Jubilate; two versions) F DorianG minor
atbSATB Tr Ob 2Vl 2Va Bas Bc 2: 59Все ответы (13)
Hmm, if you use the "Web page, Complete" format, it should work. (The "Web page, HTML Only" format does NOT work.)
If you use
(menu bar) View > Page Style > No Style
do you get a giant dump of all the text in the page?
If that works, it seems to indicate some problem laying it out using the standard reader view style sheet.
jscher2000 said
Hmm, if you use the "Web page, Complete" format, it should work. (The "Web page, HTML Only" format does NOT work.)
Thanks, but not it does not solve the problem.
I made sure the Complete option was selected (it is by default in my case), and when you clike the saved html, it opens a blank page. Not with the original html, only after converting the page using reader-viewer.
The file sizes are shown in the third attachment.
Yes, we're on the same page about the way you need to save and the way you did save.
Did you try turning off style rules to see what happens?
Can you think of any add-ons that could be modifying the page?
jscher2000 said
Yes, we're on the same page about the way you need to save and the way you did save.
Sorry, we are not on the same page. If I knew how to do what I want, I would not be posting about it.
Here's what I meant: You saved the file the same way I did, mine shows the text, yours does not. This part is all settled.
Can you please focus on my second question now?
jscher2000 said
Here's what I meant: You saved the file the same way I did, mine shows the text, yours does not. This part is all settled.
OK, sorry
Can you please focus on my second question now?
I don't understand it. Obviously, Reader is modifying the page, which is as intended, online. Why is the page saved after toggling to the Reader blank? That's my question.
I have only 3 add-ons and the two others are neither running nor likely to interfere.
Does the problem not replicate on other machines?
https://en.wikipedia.org/wiki/List_of_compositions_by_Johann_Sebastian_Bach
erw1 said
Does the problem not replicate on other machines? https://en.wikipedia.org/wiki/List_of_compositions_by_Johann_Sebastian_Bach
This was the result of my test (screenshot attached). I already updated this morning, but I don't know if that makes a difference.
Thanks.
Here are the Reader files, as saved on my machine:
https://expirebox.com/download/b29dfaf8f6fd0c238f4425f6da33ef7f.html
Would someone mind checking how they work on their machine?
Sorry, Firefox won't let me download the file, says it contains a virus. That can happen if you use a file hosting site with a bad reputation, even if the file itself is clean.
But you already confirmed the text is in the file. How does it display in your other browser(s)?
I'll try on Windows another day. Meanwhile here's the same file uploaded to Google Drive:
https://drive.google.com/open?id=139sU6riuYqu83rBlB44XlCVGXUWHZ4g4
PS: I don't have another browser on Linux.
Thanks for the file. There is a key difference on the title div and main content div:
Mine:
<div class="header reader-header reader-show-element" dir="ltr">
<div class="moz-reader-content line-height3 reader-show-element" dir="ltr">
Yours:
<div class="header reader-header" style="display: block;" dir="ltr">
<div class="moz-reader-content line-height4" style="display: block;" dir="ltr">
I don't know what is causing that difference, but it might be related to my using Firefox 62.
When viewed in the browser, the display: block; gets stripped from your tags, returning the content to a hidden state.
That seems to be caused by a Content Security Policy (CSP) restriction in the page that is inactive when you view the page directly from the server, but takes over in a saved file (this is the second line of the file):
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; img-src *; media-src *">
While you can defeat this by completely disabling CSP in Firefox, that's not a safe way to browse.
As a crude "hack-around," you could try this snippet of code to restore the stripped style rule. To apply it, open the Web Console using either:
- "3-bar" menu button > Web Developer > Web Console
- (menu bar) Tools > Web Developer > Web Console
- (Linux) Ctrl+Shift+k
Then paste this line of script in the blank at the bottom and press Enter/Return to execute it. The first time, Firefox should warn you that it's dangerous to run code from strangers and make you acknowledge that before you can run it.
document.querySelector('div.header.reader-header').style.display = 'block'; document.querySelector('div.moz-reader-content').style.display = 'block';
If you have a lot of these pages, a user script or bookmarklet would be much more convenient.
Or a bulk text-file editor could remove that CSP line from the files you saved from Wikipedia.