/* 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/. */ "use strict"; // This is loaded into chrome windows with the subscript loader. Wrap in // a block to prevent accidentally leaking globals onto `window`. { ChromeUtils.defineESModuleGetters(this, { 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. */ class MozSplitViewFooter extends MozXULElement { #initialized = false; #isInsecure = false; /** @type {HTMLSpanElement} */ securityElement = null; /** @type {HTMLImageElement} */ iconElement = null; #iconSrc = ""; /** @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 {XULElement} */ #tab = null; static markup = `