我怎样才能捕获文件> Firefox 插件中的打印事件?

发布于 2024-12-16 22:22:25 字数 241 浏览 1 评论 0原文

我想创建一个 Firefox 附加组件,用它捕获“文件 > 打印”浏览器事件以停止它。有谁知道如何赶上这个活动吗?我在 browser.xul 文件中找到命令:

   <command id="cmd_print" oncommand="goDoCommand('cmd_print')"/>

Can I catch goDoCommand('cmd_print') event?

I want to create a Firefox add-on with which I catch the "file > print" browser event for stop it. Does anyone know how to catch this event? I find in browser.xul file the command:

   <command id="cmd_print" oncommand="goDoCommand('cmd_print')"/>

Can I catch goDoCommand('cmd_print') event?

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

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

发布评论

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

评论(1

似梦非梦 2024-12-23 22:22:25

更简单的方法是简单地覆盖该命令,使其不执行任何操作。

在您的 XUL 覆盖层中,执行以下操作:

<commandset id="mainCommandSet">
  <command id="cmd_print" oncommand=""/>
</commandset>

这应该不会导致执行 cmd_print 时发生任何事情。

An easier thing to do would be to simply overlay the command so it does nothing.

In your XUL overlay, do this:

<commandset id="mainCommandSet">
  <command id="cmd_print" oncommand=""/>
</commandset>

This should cause nothing to happen when cmd_print is executed.

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