diff --git a/browser/base/content/webext-panels.js b/browser/base/content/webext-panels.js index b09747bf92f1..9361e3972cd4 100644 --- a/browser/base/content/webext-panels.js +++ b/browser/base/content/webext-panels.js @@ -70,6 +70,33 @@ function getBrowser(panel) { stack.appendChild(browser); + browser.addEventListener( + "DoZoomEnlargeBy10", + () => { + let { ZoomManager } = browser.ownerGlobal; + let zoom = browser.fullZoom; + zoom += 0.1; + if (zoom > ZoomManager.MAX) { + zoom = ZoomManager.MAX; + } + browser.fullZoom = zoom; + }, + true + ); + browser.addEventListener( + "DoZoomReduceBy10", + () => { + let { ZoomManager } = browser.ownerGlobal; + let zoom = browser.fullZoom; + zoom -= 0.1; + if (zoom < ZoomManager.MIN) { + zoom = ZoomManager.MIN; + } + browser.fullZoom = zoom; + }, + true + ); + return readyPromise.then(() => { ExtensionParent.apiManager.emit( "extension-browser-inserted", diff --git a/browser/components/customizableui/PanelMultiView.jsm b/browser/components/customizableui/PanelMultiView.jsm index 556d260a86da..996b63330021 100644 --- a/browser/components/customizableui/PanelMultiView.jsm +++ b/browser/components/customizableui/PanelMultiView.jsm @@ -338,7 +338,7 @@ var PanelMultiView = class extends AssociatedToNode { return ( doc.getElementById(id) || - viewCacheTemplate.content.querySelector("#" + id) + viewCacheTemplate?.content.querySelector("#" + id) ); } diff --git a/browser/modules/ZoomUI.jsm b/browser/modules/ZoomUI.jsm index 3c84a654110b..d3eafe2ac717 100644 --- a/browser/modules/ZoomUI.jsm +++ b/browser/modules/ZoomUI.jsm @@ -133,6 +133,12 @@ async function updateZoomUI(aBrowser, aAnimate = false) { win.document, "appMenu-zoomReset-button" ); + + // Exit early if UI elements aren't present. + if (!appMenuZoomReset) { + return; + } + let customizableZoomControls = win.document.getElementById("zoom-controls"); let customizableZoomReset = win.document.getElementById("zoom-reset-button"); let urlbarZoomButton = win.document.getElementById("urlbar-zoom-button");