diff --git a/browser/extensions/activity-stream/lib/PlacesFeed.jsm b/browser/extensions/activity-stream/lib/PlacesFeed.jsm index 2ccd81f162f8..91bf27fc4fff 100644 --- a/browser/extensions/activity-stream/lib/PlacesFeed.jsm +++ b/browser/extensions/activity-stream/lib/PlacesFeed.jsm @@ -293,7 +293,7 @@ class PlacesFeed { break; } case at.BOOKMARK_URL: - NewTabUtils.activityStreamLinks.addBookmark(action.data, action._target.browser); + NewTabUtils.activityStreamLinks.addBookmark(action.data, action._target.browser.ownerGlobal); break; case at.DELETE_BOOKMARK_BY_ID: NewTabUtils.activityStreamLinks.deleteBookmark(action.data); diff --git a/toolkit/modules/NewTabUtils.jsm b/toolkit/modules/NewTabUtils.jsm index 2cf4a88df712..c323df8b7679 100644 --- a/toolkit/modules/NewTabUtils.jsm +++ b/toolkit/modules/NewTabUtils.jsm @@ -1289,14 +1289,15 @@ var ActivityStreamLinks = { * @param {Object} aData * aData.url The url to bookmark * aData.title The title of the page to bookmark - * @param {Browser} aBrowser - * a element + * @param {Window} aBrowserWindow + * The current browser chrome window * * @returns {Promise} Returns a promise set to an object representing the bookmark */ - addBookmark(aData, aBrowser) { + addBookmark(aData, aBrowserWindow) { const {url, title} = aData; - return aBrowser.ownerGlobal.PlacesCommandHook.bookmarkPage( + return aBrowserWindow.PlacesCommandHook.bookmarkLink( + PlacesUtils.bookmarksMenuFolderId, url, title); },