I want to learn English by Kindle, so read a English web page is a good choice
Now install Caiyunxiaoyi Chrome Extension
https://chrome.google.com/webstore/detail/lingocloud-web-translatio/jmpepeebcbihafjjadogphmbgiffiajh
Calibre Convertor
https://manual.calibre-ebook.com/generated/en/ebook-convert.html
-
open link like https://wiki.archlinux.org/index.php/installation_guide
-
click caiyun extension
-
open F12 and copy following js code in Console
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
async function scroller() {
let position = 0;
while (position <= document.body.scrollHeight)
{
position += 50;
scroll(0, position);
await sleep(80)
}
}
scroller();
- save a fully html document as local file
var saveData = (function () {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
return function (data, fileName) {
var json = data,
blob = new Blob([json], {type: "text/plain;charset=utf-8"}),
url = window.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
};
}());
var data = document.documentElement.outerHTML;
var fileName = "document.html";
saveData(data, fileName);
- convert with calibre
@ECHO OFF
echo %date%
set YYYYMMDD=%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%
echo %YYYYMMDD%
set _TIME=%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set NAME=%YYYYMMDD%%_TIME%
echo %NAME%
chcp 65001
ebook-convert.exe document.html document%YYYYMMDD%%_TIME%.mobi --filter-css ',background,color,background-color,font-family' --mobi-file-type both --pretty-print
ebook-meta.exe --authors lin --publisher calibre
javascript如何能简短优雅地实现sleep函数? - 贺师俊的回答 - 知乎
https://www.zhihu.com/question/31636244/answer/52835780
JavaScript: Save a blob to disc · GitHub
https://gist.github.com/philipstanislaus/c7de1f43b52531001412
How to download a blob file from Chrome iOS in Javascript?
页面自动滚动