Thunderbird 的拖放处理
有人处理过来自雷鸟的电子邮件拖放吗? 有参考链接代码吗?
我希望能够将电子邮件从 Thunderbird 拖到我的应用程序中?
Has anyone ever handled a drag drop of emails from thunderbird? any references links code?
I want to be able to drag emails from thunderbird to my application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来这是不可能的。 虽然我似乎找不到任何实际的文档,但这是我迄今为止的实验发现的内容。
当针对 IMAP 服务器进行测试时,Thunderbird 提供具有以下 MIME 类型的投放数据:
text/x-moz-message
- UTF-16 编码的 URL,类似于imap-message://user @server/FOLDER#ID
text/x-moz-url
- UTF-16 编码的 URL,看起来像imap://user@server:port/fetch%3EUID% 3E/FOLDER%3EID
text/uri-list
- ASCII (?) URL,类似于imap://user@host:port/fetch%3EUID%3E/FOLDER %3EID"
_NETSCAPE_URL
- ASCII (?) URL,类似于imap://user@host:port/fetch%3EUID%3E/FOLDER%3EID
application/x-moz-file-promise-url
- UTF-16 编码的 URL,看起来像imap://user@host:port/fetch%3EUID%3E/FOLDER%3EID? fileName=SUBJECT.eml
application/x-moz-file-promise
- 空It looks like it isn't possible. Although I can't seem to find any actual documentation, here is what my experimentation has found so far.
Thunderbird provides drop data with the following MIME types, when tested against an IMAP server:
text/x-moz-message
- UTF-16 encoded URL that looks likeimap-message://user@server/FOLDER#ID
text/x-moz-url
- UTF-16 encoded URL that looks likeimap://user@server:port/fetch%3EUID%3E/FOLDER%3EID
text/uri-list
- ASCII (?) URL that looks likeimap://user@host:port/fetch%3EUID%3E/FOLDER%3EID"
_NETSCAPE_URL
- ASCII (?) URL that looks likeimap://user@host:port/fetch%3EUID%3E/FOLDER%3EID
application/x-moz-file-promise-url
- UTF-16 encoded URL that looks likeimap://user@host:port/fetch%3EUID%3E/FOLDER%3EID?fileName=SUBJECT.eml
application/x-moz-file-promise
- Empty相关的 Thunderbird 代码位于此处,但 AFAICS 尚未完成。 ..我所做的是编写一个 Thunderbird 扩展,它覆盖
#threadTree treechildren
的draggesture
事件,并调用稍加修改的ThreadPaneOnDragStart
版本,该版本写入拖动的消息位于临时目录内的某个位置(使用 SaveMessageToDisk),返回文件名为 application/x-moz-file-promise(或任何您想要捕获的内容)在您的应用程序中)。这有两个缺点。 因为文件是在拖动开始时创建的,而不是在拖动结束时创建的:
The relevant Thunderbird code is here, but AFAICS it is not finished... What I did was writing a Thunderbird extension that overrides the
draggesture
event of#threadTree treechildren
and calls a slightly modified version ofThreadPaneOnDragStart
that writes the dragged message somewhere inside the temp directory (usingSaveMessageToDisk
), returning the file name asapplication/x-moz-file-promise
(or whatever you'd like to catch inside your application).This has two drawbacks. since the file is created when dragging starts and not when it ends: