修改 Google Chrome 或 Mozilla Firefox 显示设置

发布于 2024-08-08 02:42:56 字数 93 浏览 3 评论 0原文

我想知道是否可以修改 Chrome 或 Firefox 显示设置,使其仅显示 HTML DOM 对象的矩形?我想做的是尽可能减少渲染引擎的工作量,因此它只会构建页面的布局。

I would like to know if it is possible to modify Chrome or Firefox display settings, so that it would only show rectangles of HTML DOM objects? What I want to do is to decrease rendering engine job amount as much as possible, so it would only build layout of the page.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故事灯 2024-08-15 02:42:56

人们通常将这种操作模式称为“无头”(即没有 UI)。

通常还有一个额外的要求 - 能够在服务器端运行它,而无需安装通常的客户端软件。如果您在客户端运行它,我不会担心优化,无论如何它都不会给您带来巨大的胜利。

否则,请尝试使用该术语进行搜索。我已经多次看到它提出要求,但还没有看到可用的现成解决方案。

[编辑]刚刚看到http://hg.mozilla.org/incubator/offscreen,其中似乎是 Mozilla 的无头版本。

People usually refer to this mode of operation as "headless" (i.e. without UI).

Usually there's an additional requirement - to be able to run it server-side without the usual for client software installed. If you're running it client-side, I wouldn't bother about optimization, it shouldn't give you a big win anyway.

Otherwise, try searching using that term. I've seen it asked for several times, but haven't seen a working out-of-box solution.

[edit] just saw http://hg.mozilla.org/incubator/offscreen, which seems to be a headless version of Mozilla.

眼趣 2024-08-15 02:42:56

我不会像修改渲染器那样低级。相反,我建议您使用 Firefox 的 Greasemonkey 来替换页面包含您需要的任何内容。您需要了解一些 JavaScript,但这并不难。

但是,这仅适用于客户端。如果您想在服务器端执行此操作(以便它可以在用户通过您自己请求的任何页面上工作),我的猜测是您需要以字符串形式获取页面的内容,然后使用 HTML 对其进行修改解析器。

I wouldn't go as low-level as modifying the renderer. Instead, I suggest you use Firefox's Greasemonkey to replace the elements from the page with whatever it is you need. You'll need to know a bit of JavaScript, but it's not that hard.

However, this will only work on client side. If you want to do this on server-side ( so that it will work on any page a user requests through your own ), my guess is you'll need to grab the page's content in a string, and then modify it using a HTML parser.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文