зеркало из https://github.com/mozilla/pjs.git
Bug 304748 - 'Bookmark This Tab' command doesn't work if the context element is the tabbar itself. r=mconnor
This commit is contained in:
Родитель
37afa4e39e
Коммит
ebdca321ca
|
@ -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)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче