Yea, context isn't available to startup_ functions. I think there's a
bug filed for that somewhere.
Try the following snippet to get the chrome window within a startup_
function:
var chromeWindow =
Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator)
.getMostRecentWindow("navigator:browser");
- Blair
On 20/01/2009 5:28 AM, Aurimas wrote:
> This simple function should display an alert on Firefox startup:
> function startup_test1() { window.alert(1); }
>
> But it throws an error: "The global window object is deprecated in
> command feeds. Please use context.chromeWindow instead." So I've
> changed window to context.chromeWindow: function startup_test2() {
> context.chromeWindow.alert(2); }
>
> But it throws another error: "Error: context is not defined". Though
> it seems to work if I make it as a command by changing startup_ in
> the function name to cmd_.
>
> So, how can I access chrome window on browser startup?
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---