Bug 693891 - Make "Add to Home Screen" use the Bookmark title instead of the page title, to allow you to name the shortcut whatever you want. r=mfinkle

This commit is contained in:
Dave Miller 2011-11-05 10:52:24 +00:00
parent e35ed10ff2
commit 678539f8ff

View File

@ -47,6 +47,13 @@ var BookmarkPopup = {
this.hide();
let browser = getBrowser();
Util.createShortcut(browser.contentTitle, browser.currentURI.spec, browser.mIconURL, "bookmark");
let itemId = PlacesUtils.getMostRecentBookmarkForURI(browser.currentURI);
let title = "";
if (itemId == -1)
title = browser.contentTitle;
else
title = PlacesUtils.bookmarks.getItemTitle(itemId);
Util.createShortcut(title, browser.currentURI.spec, browser.mIconURL, "bookmark");
}
};