With TB3 this works :
var windowManager =
Components.classes['@mozilla.org/appshell/window-mediator;1']
.getService(Components.interfaces.nsIWindowMediator);
var winId = windowManager.getMostRecentWindow("mail:3pane");
winId.focus();
winId.document.getElementById('tabmail').openTab("folder",
{folder: msgHdr.folder, msgHdr:msgHdr, messagePaneVisible:true } );
.. but NOT with SM2.
Error: tabMode is undefined
Source File: chrome://messenger/content/tabmail.xml
Line: 409
Tracing with Venkman shows the error is thrown with "winId.focus();" .
Any difference here for SM2 compared with TB3??
Note:
With Postbox 1.02 this works :
var windowManager =
Components.classes['@mozilla.org/appshell/window-mediator;1']
.getService(Components.interfaces.nsIWindowMediator);
var winId = windowManager.getMostRecentWindow("mail:3pane");
winId.focus();
winId.MsgOpenNewTabForFolder(folderUri, msgHdr.messageKey /*key*/,
false /*aBackground*/)
}
Running your snippet of code I get "msgHdr is undefined".
> Help request for TB3 vs SM2
>
> With TB3 this works :
> var windowManager =
> Components.classes['@mozilla.org/appshell/window-mediator;1']
> .getService(Components.interfaces.nsIWindowMediator);
>
> var winId = windowManager.getMostRecentWindow("mail:3pane");
> winId.focus();
> winId.document.getElementById('tabmail').openTab("folder",
> {folder: msgHdr.folder, msgHdr:msgHdr, messagePaneVisible:true } );
>
> .. but NOT with SM2.
> Error: tabMode is undefined
> Source File: chrome://messenger/content/tabmail.xml
> Line: 409
>
> Tracing with Venkman shows the error is thrown with "winId.focus();" .
Actually the error is on the next line where you call openTab
> Any difference here for SM2 compared with TB3??
I think you can use this:
winId.document.getElementById('tabmail')
.openTab("3pane", kTabModeFolder, aFolderURI, aMsgHdr);
Where:
const kTabShowFolderPane = 1 << 0;
const kTabShowMessagePane = 1 << 1;
const kTabShowThreadPane = 1 << 2;
const kTabModeFolder = kTabShowFolderPane | kTabShowThreadPane |
kTabShowMessagePane;
Phil
--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
The specific situation here is: ReminderFox on SM works for both parts,
the browser and the messenger.
So when we are working with the browser and try to open a message from
the reminderfox list this will fail.
For FX we have a call to TB/PB with a specific cmdline handler. Think
that should not be necessary with SM. But I need to 'activate' the
messenger part of SM somehow -- open the main messenger window (similar
to user press Cltr+2).
Any thoughts??
G�nter
> The specific situation here is: ReminderFox on SM works for both parts,
> the browser and the messenger.
> So when we are working with the browser and try to open a message from
> the reminderfox list this will fail.
>
> For FX we have a call to TB/PB with a specific cmdline handler. Think
> that should not be necessary with SM. But I need to 'activate' the
> messenger part of SM somehow -- open the main messenger window (similar
> to user press Cltr+2).
var windowManager =
Components.classes['@mozilla.org/appshell/window-mediator;1']
.getService(Components.interfaces.nsIWindowMediator);
var winId = windowManager.getMostRecentWindow("mail:3pane");
if (winId)
{
winId.focus();
winId.document.getElementById('tabmail').openTab("3pane",
kTabModeFolder, aFolderURI, aMsgHdr);
}
else
{
winId = window.openDialog("chrome://messenger/content/", "",
"all,dialog=no");
winId.addEventListener("load", yourListener, false);
}
// Then in your listener you can do something like:
function yourListener(event)
{
// make sure that this handler is called only once
winId.removeEventListener("unload", yourListener, false);