拦截来自 Firefox 插件的文件上传

发布于 2024-11-25 05:25:03 字数 218 浏览 3 评论 0原文

我正在开发一个插件,它将拦截所有文件上传并根据用户确认对话框继续或中止它们。

使用 javascript DOM 处理执行此操作似乎无法获取为任意网站上传文件的所有可能方式,因为文件上传不再仅由 和某些网站识别正在使用 flash 元素进行上传。

有什么方法可以拦截文件选择对话框或文件输入流来实现此目的吗?还有其他建议吗?

I am developing an addon that shall intercept all file uploads and continue or abort them according to a user confirmation dialog.

Doing this with javascript DOM handling does not seem to fetch all possible ways of uploading files for arbitrary websites, since file uploads are no longer solely recognized by <input type="file"> and some sites are using flash elements for uploading.

Is there any way I can intercept either the file selection dialog or the file input stream to achieve this? Any other suggestions?

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

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

发布评论

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

评论(1

被翻牌 2024-12-02 05:25:03

您可以查看 http-on-modify-request 观察者(请参阅 https://developer. mozilla.org/en/XUL_School/Intercepting_Page_Loads#HTTP_Observers)作为捕获任何 POST 请求并查看它们是否上传文件。然而,通过 Flash 拦截上传将更加困难,因为它们可能完全绕过 Firefox 堆栈并与网站进行自己的通信。在这种情况下,您需要使用某种操作系统级挂钩来拦截上传。

You could look into an http-on-modify-request observer (see https://developer.mozilla.org/en/XUL_School/Intercepting_Page_Loads#HTTP_Observers) as a way to catch any POST requests and see if they are uploading a file. Intercepting uploads via Flash will be much harder, however, since they may circumvent the Firefox stack completely and do their own communication with the website. In that case you would need to use some sort of OS-level hooks to intercept the upload.

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