工具与资源github.com
Monolith:把完整网页保存为单个 HTML 文件的命令行工具
Monolith – CLI tool for saving complete web pages as a single HTML file
2019 — 2024,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Monolith 是一个命令行工具,能把完整网页(包括 CSS、图片等资源)保存为单个 HTML 文件,方便离线存档。项目在 GitHub 上开源,曾于 2019 和 2024 两次登上 Hacker News 首页。
为什么经久不衰:网页存档是长期需求,这个工具简单实用且持续维护,是保存网页快照的经典方案。
HN 评论精选
不执行 JS 就无法完整保存现代动态网页,SingleFile 的浏览器方案更可靠
你的代码的主要问题是只能处理简单的 Web1.0 网站。JavaScript 执行怎么办?回放你的存档时,对于一般的 Web2.0 网站你根本不知道会看到什么。据我所知,正确捕获网页的唯一方法是在浏览器里'执行'它。SingleFile 的作者 Gildas 很清楚这一点,他的方法每次都有效。在 Facebook 帖子、推文上试试,都能用。
mikaelmorvan查看英文原文
The main problem with your code is that you only handle simple web1 site. What about javascript execution ? If you replay your capture, you have no idea of what you will see on general Web2 website. The only way I know to capture a web page properly is to "execute" it on a browser. Gildas, the guy behind SingleFile (https://github.com/gildas-lormeau/SingleFile) is well aware of that and his approach realy works everytime. Try on a Facebook post, a Tweet, ... It just works.
运行开源 CLI 工具时如何评估供应链安全是个被忽视的问题
每次看到原生软件发布我都会想:你们怎么处理安全问题?粗看这个仓库大约一千行代码,还有一堆依赖和数百个子依赖。你们会读所有代码、评估所有依赖的声誉吗?会在沙箱里运行吗?还是像 C64 时代那样听天由命?
FreeHugs查看英文原文
One thing I always wonder when I see native software posted here: How do you guys handle the security aspect of executing stuff like this on your machines? Skimming the repo it has about a thousand lines of code and a bunch of dependencies with hundreds of sub-dependencies. Do you read all that code and evaluate the reputation of all dependencies? Do you execute it in a sandboxed environment? Do you just hope for the best like in the good old times of the C64?
MHTML 格式早已能实现单文件存档网页
顺便说一句,MHTML 其实已经很适合做这件事(不是说这个项目不棒)。它同样把资源以 base64 data URI 形式存储并保存为单文件。基于 Blink 的浏览器可以通过设置开关启用,Firefox 过去靠插件支持,Opera 和 IE 也曾原生支持。
Springtime查看英文原文
MHTML is pretty good for this already btw (not to take away from this neat project though :)). Similarly stores assets as base64'd data URIs and saves it as a single file. Can be enabled in Blink-based browsers using a settings flag and previously in Firefox using addons (also in the past natively in Opera and IE).
README 应说明对图片、视频、JS、懒加载的处理方式
我觉得仓库里最好解释清楚:图片怎么处理?支持内嵌视频吗?支持 JS 吗,支持到什么程度?能处理懒加载资源吗(滚动才加载的图片、页面加载几秒后才加载的 JS)?总的来说它是怎么工作的?现在的 README 解释得不够好,我只能猜它大概是截图后 base64 编码进 HTML。
alpb查看英文原文
I think it would be way better to explain in the repository: - how do you handle images? - does it handle embedded videos? - does it handle JS? to what extent? - does it handle lazily loaded assets (i.e. images that load only when you scroll down, or JS that loads 3 seconds later after the page is loaded) In general, how does this work? The current readme doesn't do a decent job explaining what the tool exactly is. For all I can tell, it probably just takes a screenshot of the page, encodes as base64 into the html and shows it.
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com