【问题标题】:How does a Thunderbird addon access external data?Thunderbird 插件如何访问外部数据?
【发布时间】:2011-03-09 08:41:42
【问题描述】:

Thunderbird 插件如何访问外部数据?

我们公司想为 Thunderbird 构建一个插件,以便客户服务部门可以根据 Thunderbird 电子邮件模板向客户发送电子邮件,该模板包含外部动态数据(TB 外和本地计算机),例如客户编号、订单编号、订单详细信息、金额等...

这甚至可能吗?安全性如何?阅读 Mozilla 插件,但那里的信息没有提供足够的详细信息。

谢谢。

【问题讨论】:

    标签: external thunderbird thunderbird-addon


    【解决方案1】:

    这里有一些代码,取自伟大的XUL School Tutorial 教程中的Connecting to Remote Content。它适用于 bith Firefox 和 Thunderbird 扩展。

    var url = "http://www.example.com/";
    let request = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest);
    
    request.onload = function(aEvent) {
    window.alert("Response Text: " + aEvent.target.responseText);
    };
    
    request.onerror = function(aEvent) {
    window.alert("Error Status: " + aEvent.target.status);
    };
    
    request.open("GET", url, true);
    request.send(null);
    

    这会将异步 XMLHttpRequest 发送到 Web 服务器,并以文本或 XML 格式返回服务器响应。

    【讨论】:

      【解决方案2】:

      FiltaQuilla 有一个动作来启动外部应用程序,将参数传递给它,并可能从应用程序中获取返回结果。如果您查看其代码或在其论坛上发布问题,您可能会发现一些有用的信息。祝你好运。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-02-27
        • 1970-01-01
        • 2012-04-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多