我已經創建了執行以下操作的擴展:Thunderbid擴展:開放EML文件
當我運行Thinderbird使用命令行thunderbird -MyCustomParam1 "12345"
我的分機將打開一個撰寫窗口和參數"12345"
添加到窗口。
一些代碼,我使用:
// In the calling code
var args = {
param1: 12345,
};
args.wrappedJSObject = args;
var watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher);
watcher.openWindow(null, url, windowName, features, args);
// In the window code
var args = window.arguments[0].wrappedJSObject;
當然使用正確的URL和功能。
現在我想要做同樣的事情,但對於消息窗口和eml
文件是選擇。
您可以從命令行打開eml
文件,如下所示:Thunderbird test.eml
(這將在新窗口中打開郵件)。
我想是這樣的:
Thunderbird test.eml -MycustomParam1 "1234"
應該打開郵件,並添加帕拉姆"1234"
篩選,這樣我就可以訪問它在文檔窗口,就像例1
所以基本上我想要像watcher.openWindow
,但與給定的eml
文件。
任何想法?
謝謝。它的工作正常 – user1449511
這工作正常。但是,當我有一個HTML郵件,它打印郵件爲純文本。有沒有辦法在打開文件時指定它的HTML郵件? – user1449511
上述評論中的問題的答案:https://stackoverflow.com/questions/27689496/opening-and-printing-a-thunderbird-html-file/27690687#27690687 – user1449511