mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 304748 - 'Bookmark This Tab' command doesn't work if the context element is the tabbar itself. r=mconnor
This commit is contained in:
parent
77e6b8d4ac
commit
a31fb44d08
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user