diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index f2eca5728a06..90b76fa5b6ae 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1604,6 +1604,8 @@ var gBrowserInit = { } }); + gPageActionButton.init(); + this.delayedStartupFinished = true; Services.obs.notifyObservers(window, "browser-delayed-startup-finished"); @@ -7756,6 +7758,38 @@ var gIdentityHandler = { } }; + +var gPageActionButton = { + get button() { + delete this.button; + return this.button = document.getElementById("urlbar-page-action-button"); + }, + + get panel() { + delete this.panel; + return this.panel = document.getElementById("page-action-panel"); + }, + + init() { + if (getBoolPref("browser.photon.structure.enabled")) { + this.button.hidden = false; + } + }, + + onEvent(event) { + event.stopPropagation(); + + if ((event.type == "click" && event.button != 0) || + (event.type == "keypress" && event.charCode != KeyEvent.DOM_VK_SPACE && + event.keyCode != KeyEvent.DOM_VK_RETURN)) { + return; // Left click, space or enter only + } + + this.panel.hidden = false; + this.panel.openPopup(this.button, "bottomcenter topright"); + }, +}; + function getNotificationBox(aWindow) { var foundBrowser = gBrowser.getBrowserForDocument(aWindow.document); if (foundBrowser) diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 077e64c49f5a..711418e0d86f 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -405,6 +405,16 @@ + + @@ -802,6 +812,11 @@ class="chromeclass-toolbar-additional" command="Browser:Stop" tooltip="dynamic-shortcut-tooltip"/> +