How turn on the function 'Save as type *.txt'?
-
helium last edited by
I saved txt-files via the function 'Save as type *.txt'
in Netscape v1-v9 (1991-2006) and Opera v1-v11 (2000-2006).
But I don't find the function in the current version of Opera v68.0.3618.125.
How to turn on the function?My current system is Windows7-64 on notebook (2012) i5-HM65-16Gb Geforce-GT540M-1Gb hdd-1Tb.
There are screenshots below.
Netscape v9:
http://d.radikal.ru/d13/2005/70/8933af462184.png
Opera v11:
http://c.radikal.ru/c12/2005/c6/5b413ae0bfd6.png
Current Opera v68.0.3618.125:
http://a.radikal.ru/a14/2005/ee/42ff4fb46312.png -
burnout426 Volunteer last edited by
There's a goofy way to do it.
-
Bookmark some page so you have a bookmark to edit.
-
Goto the URL
opera://bookmarks
and click the edit button for the bookmark. -
Change the bookmark's title to "Open Page as Plain Text" and change its URL to:
javascript:(function()%20%7B%0D%0A%20%20%20%20window.open(%22data%3Atext%2Fplain%3Bcharset%3Dutf-8%2C%22%20%2B%20encodeURIComponent(document.body.innerText))%3B%0D%0A%7D)()%3B
-
Press Enter to apply the change.
Then, when you're on the page, invoke the bookmark through menu -> bookmarks. It will try to open up a text/plain data URI in a new window. It'll be blocked by the popup blocker, but you can open it via the icon at the right of the address field. Once the data URI is opened in a new tab, you'll have to focus the address field and press enter to reload the URI in the tab so the content of the data URI shows. You'll then be able to ctrl + s on the page to save it as a text file and name the file what you want.
It makes use of document.body.innerText, which basically gets the text of the body with whitespace formatting.
-
-
burnout426 Volunteer last edited by
I guess you could ctrl + shift + j to open the console and enter:
copy(document.body.innerText);
to copy the text to the clipboard. You could then ctrl + v into a text editor and save.
That way, you wouldn't have to go through and select everything manually on the page and copy it.
-
burnout426 Volunteer last edited by burnout426
Better bookmarklet way:
-
Bookmark a page so you can edit its bookmark on the
opera://bookmarks
page. -
Change the bookmark's name to "Save Page as Text File".
-
Change its URL to:
javascript:(function()%20%7B%0D%0A%20%20%20%20var%20link%20%3D%20document.createElement(%22a%22)%3B%0D%0A%20%20%20%20link.download%20%3D%20document.title%20%2B%20%22.txt%22%3B%0D%0A%20%20%20%20link.href%20%3D%20%22data%3Atext%2Fplain%3Bcharset%3Dutf-8%2C%22%20%2B%20encodeURIComponent(document.body.innerText)%3B%0D%0A%20%20%20%20link.click()%3B%0D%0A%7D)()%3B
Then, when you're on a page, goto Menu -> Bookmarks and invoke the bookmark. The page will then automatically be downloaded as text with a filename of "page's title.txt".
The source of the bookmarklet is:
(function() { var link = document.createElement("a"); link.download = document.title + ".txt"; link.href = "data:text/plain;charset=utf-8," + encodeURIComponent(document.body.innerText); link.click(); })();
, which you can paste in the console if you want to test it that way. You can modify it to strip characters from the filename that are not allowed and limit the length of the filename if you really want to.
-