如何在 Firefox 扩展中挂钩下载对话框? [英] How to hook the download dialog in a Firefox extension?

查看:23
本文介绍了如何在 Firefox 扩展中挂钩下载对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写 Firefox 扩展程序,我需要挂钩用户尝试下载文件时出现的下载对话框.

I'm writing a Firefox extension and I need to hook the download dialog that comes up when the user tries to download a file.

换句话说,我需要一个脚本定义的函数来通知而不是对话框正常显示.

In other words, I need a script-defined function to be notified instead of the dialog appearing as normal.

我从哪里开始?我尝试通读 XPCOM API 参考...但 this 是我能找到的最接近的东西.

Where do I begin? I tried reading through the XPCOM API Reference... but this is the closest thing I could find.

推荐答案

你需要覆盖 nsIDownloadManagerUI(通过实现它).

You need to override nsIDownloadManagerUI (by implementing it).

这篇关于如何在 Firefox 扩展中挂钩下载对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆