diff --git a/browser/app/blocklist.xml b/browser/app/blocklist.xml index 496f99055a66..5b8899b72038 100644 --- a/browser/app/blocklist.xml +++ b/browser/app/blocklist.xml @@ -1,5 +1,5 @@ - + @@ -3594,6 +3594,7 @@ 0x0046 BLOCKED_DRIVER_VERSION 8.15.10.2086 EQUAL + All 0x8086 FEATURE_HARDWARE_VIDEO_DECODING BLOCKED_DRIVER_VERSION 10.18.10.3947 EQUAL @@ -3731,9 +3732,6 @@ O2S99lVUxErLSk56GvWRv+E= - - - F7PAjw2k0dTX5escPnyVOBo= Mq0P6o03FDk0B2bnJ+mYPGo= @@ -3770,6 +3768,174 @@ TA6EVg== + + + CWhp + + + XhcFm2g619rt8Sro+a4rHA== + + + EDQMI0tR4kSntv1O37N10g== + + + P6G7IYSL2RZxtzTh8I6qPA== + + + HNo1DR4XCe4mS1iUMsY6Wg== + + + KjoVfZ3by6+pL8fssyfM6A== + + + UW3oKZKTDsrPy/rfwmGNaQ== + + + XLhHIg7vP+tWfRqvuKeAxw== + + + YNOos6YJoPC77qwSGCpb7w== + + + dItWlz2V62Philqj9m6Pbg== + + + ORFgmCj072NjcJnrxOMfQA== + + + L79XLVO2ZmtAu7FAG8Wmzw== + + + H08= + + + OE4/d+p3YRzzcSl+kmZ8Mw== + + + ZgwfEqZnBsUNvNuZ77FbQA== + + + OUvvVscW0/NltofkmV9qmg== + + + SdegFrLaFTCsoMAW5ED+zA== + + + VfTSum25nb65YPlpuhJAvg== + + + WX89jn8yGZVvoKTD9jDfRQ== + + + cpqpXVWPk5AXzGw+zNIcBw== + + + RUT1Gehd1KKYPfqOlgspoQ== + + + bx/XHJqcwxDOptxJ2lh5vw== + + + AuhvPsYZfVP6UDsuyjeZ4Q== + + + OhrtngFwotLcm4i+z00SjA== + + + U3SgRR3J+D6575WuCxuXeQ== + + + UVKsEezpGWOVQ4W9esstng== + + + acI1CFIgmwSFBoU5+ahDgg== + + + Sx51x7V8pYe8rp7PMP/3qg== + + + PAdKZPiaac2CvPxbOrsHOw== + + + E77H6yvyFQjO0PcN3x0H+Q== + + + d8AtKymQwkOPDBj+hjPzFg== + + + TurPPI6eivtNeGYdM0ZWXQ== + + + a9/VeyVWrzFD7rM2PEHwQA== + + + LnfcUaXG/pxV2CpXM5+YSg== + + + AygWP2Fgd2T+iLbmAlKT6g== + + + ezdAeCxKH7BFs7vn3byYaw== + + + 45KI4WIxyXfNrdtdj7C6 + + + UMUwXwT1Z4juyQ/CNTf4mw== + + + HZyLf+K70FKc+jomm8DiDw== + + + IIxFSyNM6mWtCgTG0IL3Og== + + + Rvm2CEw2IC2Mu/ax0A46QQ== + + + TqfXw+FkhxfVgE9GVMgjWQ== + + + E5I2y6sIonl4a+TmlXc7fw== + + + GdXz4L1b6FKNCMG9Jz2tjA== + + + BUrYjru5px1ym4QUN33TOQ== + + + CqZgEvHAsnzkT//QV9KjXw== + + + DYifRdP6aQQ8MLbXZY2f5g== + + + cDggUYfwJ3A1YcdoeT6s4A== + + + e0bEFhI16xx9U1yvlI56rA== + + + UKKK5ol/rKBZchAAOnZjaA== + + + FNISyWWTGi5Yco6fGh58/A== + + + JpUvYJyWjdGmeoH7YcYunw== + + + OnvXX72mvUI2Id/NMzegmg== + + + QZBvapTZFvmYktEPsBYLQQ== + + + OqQ2rV0ISTc308Z/oQgzFw== + + + NvEJoRYL2yvAZrAjbDIipQ== diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 41f6d0c442ba..4321e43a1f5e 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -486,6 +486,8 @@ pref("browser.bookmarks.autoExportHTML", false); // 0: no backups created (and deletes all existing backups) pref("browser.bookmarks.max_backups", 15); +pref("browser.bookmarks.showRecentlyBookmarked", true); + // Scripts & Windows prefs pref("dom.disable_open_during_load", true); pref("javascript.options.showInConsole", true); diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index b9325bca3205..46b86e5c3e7a 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -550,11 +550,14 @@ var PlacesCommandHook = { get uniqueCurrentPages() { let uniquePages = {}; let URIs = []; - gBrowser.visibleTabs.forEach(function (tab) { - let spec = tab.linkedBrowser.currentURI.spec; + + gBrowser.visibleTabs.forEach(tab => { + let browser = tab.linkedBrowser; + let uri = browser.currentURI; + let spec = uri.spec; if (!tab.pinned && !(spec in uniquePages)) { uniquePages[spec] = null; - URIs.push(tab.linkedBrowser.currentURI); + URIs.push({ uri, title: browser.contentTitle }); } }); return URIs; @@ -1326,8 +1329,8 @@ var BookmarkingUI = { return; } - this._updateRecentBookmarks(document.getElementById("BMB_recentBookmarks"), - "subviewbutton"); + this._initRecentBookmarks(document.getElementById("BMB_recentBookmarks"), + "subviewbutton"); if (!this._popupNeedsUpdate) return; @@ -1362,7 +1365,68 @@ var BookmarkingUI = { }); }, - _updateRecentBookmarks: function(aHeaderItem, extraCSSClass = "") { + RECENTLY_BOOKMARKED_PREF: "browser.bookmarks.showRecentlyBookmarked", + + _initRecentBookmarks(aHeaderItem, aExtraCSSClass) { + this._populateRecentBookmarks(aHeaderItem, aExtraCSSClass); + + // Add observers and listeners and remove them again when the menupopup closes. + + let bookmarksMenu = aHeaderItem.parentNode; + let placesContextMenu = document.getElementById("placesContext"); + + let prefObserver = () => { + this._populateRecentBookmarks(aHeaderItem, aExtraCSSClass); + }; + + let updatePlacesContextMenu = (shouldHidePrefUI = false) => { + let prefEnabled = !shouldHidePrefUI && Services.prefs.getBoolPref(this.RECENTLY_BOOKMARKED_PREF); + document.getElementById("placesContext_showRecentlyBookmarked").hidden = shouldHidePrefUI || prefEnabled; + document.getElementById("placesContext_hideRecentlyBookmarked").hidden = shouldHidePrefUI || !prefEnabled; + document.getElementById("placesContext_recentlyBookmarkedSeparator").hidden = shouldHidePrefUI; + }; + + let onPlacesContextMenuShowing = event => { + if (event.target == event.currentTarget) { + let triggerPopup = event.target.triggerNode; + while (triggerPopup && triggerPopup.localName != "menupopup") { + triggerPopup = triggerPopup.parentNode; + } + let shouldHidePrefUI = triggerPopup != bookmarksMenu; + updatePlacesContextMenu(shouldHidePrefUI); + } + }; + + let onBookmarksMenuHidden = event => { + if (event.target == event.currentTarget) { + updatePlacesContextMenu(true); + + Services.prefs.removeObserver(this.RECENTLY_BOOKMARKED_PREF, prefObserver, false); + placesContextMenu.removeEventListener("popupshowing", onPlacesContextMenuShowing); + bookmarksMenu.removeEventListener("popuphidden", onBookmarksMenuHidden); + } + }; + + Services.prefs.addObserver(this.RECENTLY_BOOKMARKED_PREF, prefObserver, false); + placesContextMenu.addEventListener("popupshowing", onPlacesContextMenuShowing); + bookmarksMenu.addEventListener("popuphidden", onBookmarksMenuHidden); + }, + + _populateRecentBookmarks(aHeaderItem, aExtraCSSClass = "") { + while (aHeaderItem.nextSibling && + aHeaderItem.nextSibling.localName == "menuitem") { + aHeaderItem.nextSibling.remove(); + } + + let shouldShow = Services.prefs.getBoolPref(this.RECENTLY_BOOKMARKED_PREF); + let separator = aHeaderItem.previousSibling; + aHeaderItem.hidden = !shouldShow; + separator.hidden = !shouldShow; + + if (!shouldShow) { + return; + } + const kMaxResults = 5; let options = PlacesUtils.history.getNewQueryOptions(); @@ -1372,11 +1436,6 @@ var BookmarkingUI = { options.maxResults = kMaxResults; let query = PlacesUtils.history.getNewQuery(); - while (aHeaderItem.nextSibling && - aHeaderItem.nextSibling.localName == "menuitem") { - aHeaderItem.nextSibling.remove(); - } - let onItemCommand = function (aEvent) { let item = aEvent.target; openUILink(item.getAttribute("targetURI"), aEvent); @@ -1397,8 +1456,9 @@ var BookmarkingUI = { "menuitem"); item.setAttribute("label", title || uri); item.setAttribute("targetURI", uri); + item.setAttribute("context", "hideRecentlyBookmarked"); item.setAttribute("class", "menuitem-iconic menuitem-with-favicon bookmark-item " + - extraCSSClass); + aExtraCSSClass); item.addEventListener("command", onItemCommand); if (icon) { item.setAttribute("image", icon); @@ -1407,6 +1467,15 @@ var BookmarkingUI = { } root.containerOpen = false; aHeaderItem.parentNode.insertBefore(fragment, aHeaderItem.nextSibling); + aHeaderItem.setAttribute("context", "hideRecentlyBookmarked"); + }, + + showRecentlyBookmarked() { + Services.prefs.setBoolPref(this.RECENTLY_BOOKMARKED_PREF, true); + }, + + hideRecentlyBookmarked() { + Services.prefs.setBoolPref(this.RECENTLY_BOOKMARKED_PREF, false); }, _updateCustomizationState: function BUI__updateCustomizationState() { @@ -1599,7 +1668,7 @@ var BookmarkingUI = { this._updateBookmarkPageMenuItem(); PlacesCommandHook.updateBookmarkAllTabsCommand(); - this._updateRecentBookmarks(document.getElementById("menu_recentBookmarks")); + this._initRecentBookmarks(document.getElementById("menu_recentBookmarks")); }, _showBookmarkedNotification: function BUI_showBookmarkedNotification() { diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 87800a90e12c..e57843a3f11e 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -383,7 +383,35 @@ #include browser-context.inc - + + + + + +