diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index dd17107a84e..9281c70d70d 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -306,22 +306,28 @@ function SetClickAndHoldHandlers() { aElm.addEventListener("click", clickHandler, true); } - // Bug 414797: Clone the dropmarker's menu into both the back and - // the forward buttons. + // Bug 414797: Clone unified-back-forward-button's context menu into both the + // back and the forward buttons. var unifiedButton = document.getElementById("unified-back-forward-button"); if (unifiedButton && !unifiedButton._clickHandlersAttached) { - var popup = document.getElementById("backForwardMenu").cloneNode(true); + unifiedButton._clickHandlersAttached = true; + + let popup = document.getElementById("backForwardMenu").cloneNode(true); popup.removeAttribute("id"); - var backButton = document.getElementById("back-button"); + // Prevent the context attribute on unified-back-forward-button from being + // inherited. + popup.setAttribute("context", ""); + + let backButton = document.getElementById("back-button"); backButton.setAttribute("type", "menu"); backButton.appendChild(popup); _addClickAndHoldListenersOnElement(backButton); - var forwardButton = document.getElementById("forward-button"); + + let forwardButton = document.getElementById("forward-button"); popup = popup.cloneNode(true); forwardButton.setAttribute("type", "menu"); forwardButton.appendChild(popup); _addClickAndHoldListenersOnElement(forwardButton); - unifiedButton._clickHandlersAttached = true; } }