/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* global gBrowser, MozXULElement */ const { XPCOMUtils } = ChromeUtils.importESModule( "resource://gre/modules/XPCOMUtils.sys.mjs" ); const lazy = XPCOMUtils.declareLazy({ BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", }); /** * A footer which appears in the corner of the inactive panel in split view. * * The footer displays the favicon and domain name of the site. */ export class MozSplitViewFooter extends MozXULElement { #initialized = false; #isInsecure = false; /** @type {HTMLSpanElement} */ securityElement = null; /** @type {HTMLImageElement} */ tabImageIconElement = null; #tabImageIconSrc = ""; /** @type {HTMLSpanElement} */ uriElement = null; /** @type {nsIURI} */ #uri = null; #browserProgressListener = { QueryInterface: ChromeUtils.generateQI([ Ci.nsIWebProgressListener, Ci.nsISupportsWeakReference, ]), onLocationChange: (aWebProgress, aRequest, aLocation) => { if (aWebProgress?.isTopLevel && aLocation) { this.#updateUri(aLocation); } }, onSecurityChange: (aWebProgress, aRequest, aState) => this.#toggleInsecure( !!( aState & Ci.nsIWebProgressListener.STATE_IS_INSECURE || aState & Ci.nsIWebProgressListener.STATE_IS_BROKEN ) ), }; /** @type {MozTabbrowserTab} */ #tab = null; static markup = `