/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- * 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/. */ /* eslint-env mozilla/browser-window */ { // start private scope for Tabbrowser /** * A set of known icons to use for internal pages. These are hardcoded so we can * start loading them faster than FaviconLoader would normally find them. */ const FAVICON_DEFAULTS = { "about:newtab": "chrome://branding/content/icon32.png", "about:home": "chrome://branding/content/icon32.png", "about:welcome": "chrome://branding/content/icon32.png", "about:privatebrowsing": "chrome://browser/skin/privatebrowsing/favicon.svg", }; const { LOAD_FLAGS_NONE, LOAD_FLAGS_FROM_EXTERNAL, LOAD_FLAGS_FIRST_LOAD, LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL, LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP, LOAD_FLAGS_FIXUP_SCHEME_TYPOS, LOAD_FLAGS_FORCE_ALLOW_DATA_URI, LOAD_FLAGS_DISABLE_TRR, } = Ci.nsIWebNavigation; const DIRECTION_FORWARD = 1; const DIRECTION_BACKWARD = -1; /** * @param {MozTabbrowserTab|MozTabbrowserTabGroup} element * @returns {boolean} * `true` if element is a `` */ const isTab = element => !!(element?.tagName == "tab"); /** * @param {MozTabbrowserTab|MozTextLabel} element * @returns {boolean} * `true` if element is the `