Bug 304748 - 'Bookmark This Tab' command doesn't work if the context element is the tabbar itself. r=mconnor

This commit is contained in:
mozilla.mano%sent.com 2005-08-15 23:44:17 +00:00
parent 77e6b8d4ac
commit a31fb44d08

View File

@ -209,7 +209,7 @@ function addBookmarkMenuitems()
var bookmarkCurTabItem = document.createElement("menuitem");
bookmarkCurTabItem.setAttribute("label", gNavigatorBundle.getString("bookmarkCurTab_label"));
bookmarkCurTabItem.setAttribute("accesskey", gNavigatorBundle.getString("bookmarkCurTab_accesskey"));
bookmarkCurTabItem.setAttribute("oncommand", "addBookmarkAs((getBrowser().mContextTab).linkedBrowser, false);");
bookmarkCurTabItem.setAttribute("oncommand", "BookmarkThisTab();");
var menuseparator = document.createElement("menuseparator");
var insertPos = tabMenu.lastChild.previousSibling;
tabMenu.insertBefore(bookmarkAllTabsItem, insertPos);
@ -217,6 +217,15 @@ function addBookmarkMenuitems()
tabMenu.insertBefore(menuseparator, bookmarkCurTabItem);
}
function BookmarkThisTab()
{
var tab = getBrowser().mContextTab;
if (tab.localName != "tab")
tab = getBrowser().mCurrentTab;
addBookmarkAs(tab.linkedBrowser, false);
}
const gSessionHistoryObserver = {
observe: function(subject, topic, data)
{