I am creating a Firefox Extension...what would be the javascript to open a URL in the current tab from a menuitem?
e.g. in my overlay.xul file i have the following line:
From a menuitem you can use openUILinkIn. It works like:
openUILinkIn(url, where);
where can be: tab, current, window (and a few other seldom used options)
If you want to behave differently based on what keyboard modifiers a user is pressing, you can use another function whereToOpenLink, which returns tab/current/window based on the users preferences and modifiers.
openUILinkIn(url, whereToOpenLink(event));
Thus I use:
If you aren't in the context of a menuitem you might want to check out another built-in XBL that adds linking and opening HREFs for a label: