I use the w3m-browser on a regular basis and am really satisfied with it.
(w3m download | SourceForge.net and http://w3m.sourceforge.net/ )
It has quite a lot of advantages: distraction-free reading, no unnecessary loading of pics, gifs and ads (thus also much safer), bandwidth saving…
There´s just on thing I cannot work out.
Using a TTS (Text-to-speech) script I wrote for having the text read out to me (whenever I´m too lazy for reading…) I need to copy the output of the (whole) page to my clipboard.
By typing “m” the mouse-pointer turns into “selection” and I can copy the marked text.
Generally the output of a page is larger than a single “page” of the terminal. So I´m forced to scroll down.
By scrolling however the mark gets lost.
So basically it´s impossible to mark the first word of the page, then scroll down a few times and then mark the last word with SHIFT + left-click of the mouse. This would work in leafpad, gedit, browsers however.
So I have to copy the content of a single page, copy it to my TTS-script, then scroll down one page, repeat the procedure and so on.
these sound like they might not work in that particular browser, but i thought i would check just in case. have you tried ctrl + a? in firefox it grabs way too much (even sidebar text), but it sounds like w3m might not have the extra text or fields. the other one that also grabs too much, but might not in your situation is that i can highlight the first word of text on a wikipedia page with left click and mousing over the word (like what you describe with m), scroll to the bottom and then ctrl + shift + left mouse click highlights everything in between.
I didn´t even know about “ctrl + a” I have to admit. Shame on me.
I tried it and - as you already suggested - it didn´t work in w3m. It had no effect whatsoever, i.e. it didn´t mark anything. On chromium however this command works as you described.
I already tried you second proposal. The thing is: that one works - but only as long as I remain on the currently displayed page. When marking the first word and scrolling down to the end of the 2nd, 3rd or nth page the first mark gets lost.
As before this works in chromium, firefox, gedit etc.
It seems there´s not much that can be done to solve the problem when using w3m.
Theoretically, if scripting is sufficiently supported, you could create a script that enables “TTS mode” on a web page by pressing a specific key combination. In this TTS mode, you e.g. could reformat the website to display a lot more lines on a single terminal window, which would lead to less interruptions during TTS, as the issue you described, originally.
Yes, I was going to tell you all that I tried the direct way for a possible solution but you noticed already.
Well, I doesn´t look promising as you pointed out.
Yet by now there have been 16 views. So at least the topic seems to be watched.
If I get an answer there I´ll let you know.
I just saw your post is longer than I originally noticed.
Thanks for the link. I´ll look at it.
Could you briefly explain if it would be okay to you to use TTS out of the browser in the worst case scenario?
What if there was a dedicated tool that does it better than w3m ever could?
Because if an external program would be acceptable, I am sure there is a way to let the browser open a page in an external program which then automatically starts reading. So you keep your business with w3m as usual, but you let some of the background work to another, better program that is made for TTS’ing web pages.
in the meantime I came up with some sort of workaround (not a solution):
As w3m provides its output in the terminal it´s easy to redirect it to a text-file, like so:
w3m "https://distrowatch.com/" | tee output.txt
Yet this seems to be just a half-hearted solution as that one is only viable if no following of links are needed as the terminal-output is just plain text.
Of course “tee” can be replaced by redirection “>” if double output should be avoided.
Basically what it comes down to is the following:
If I know beforehand that I want to use TTS I can use this command as it simplifies the process of “marking all” and thus copying everything in a single step.