PageMod/page-mod 和 Page/page-worker 之间有什么区别?
我不明白其中的区别。我能看到的唯一区别是 PageMod 使用匹配模式,而 Page 使用特定的 URL。为什么不只使用 PageMod(更通用)来处理所有事情呢?
I don't understand the difference. The only difference I can see is that a PageMod uses a match pattern, whereas a Page uses a specific URL. Why not just use a PageMod (more versatile) for everything?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
page-mod
模块适用于用户在浏览器中加载的页面。page-worker
模块可让您在后台加载网页并使用它执行一些操作。例如,如果您想在用户访问所有 Google 搜索页面时添加“Super-Dooper-Search”按钮,则可以使用page-mod
。但是,如果您想在用户单击某个按钮时在后台加载 Google 搜索页面,从中提取搜索结果并将结果呈现给用户,那么您可以使用page-worker
- 而无需用户操作查看您加载的页面(仅作为示例,实际上不要这样做,因为它违反了 Google 的服务条款)。The
page-mod
module works with pages that the user loads in the browser. Thepage-worker
module lets you load a web page in the background and perform some operations with it. So you would for example usepage-mod
if you want to add a "Super-Dooper-Search" button to all Google Search pages when the user visits them. But you would usepage-worker
if you want to load the Google Search page in background when the user clicks some button, extract the search results from it and present the results to the user - without the user ever seeing the page you loaded (just as an example, don't actually do that because it violates Google's ToS).