/* 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"; const Services = require("Services"); const EventEmitter = require("devtools/shared/event-emitter"); const BROWSERTOOLBOX_FISSION_ENABLED = "devtools.browsertoolbox.fission"; const { LegacyProcessesWatcher, } = require("devtools/shared/resources/legacy-target-watchers/legacy-processes-watcher"); const { LegacyServiceWorkersWatcher, } = require("devtools/shared/resources/legacy-target-watchers/legacy-serviceworkers-watcher"); const { LegacySharedWorkersWatcher, } = require("devtools/shared/resources/legacy-target-watchers/legacy-sharedworkers-watcher"); const { LegacyWorkersWatcher, } = require("devtools/shared/resources/legacy-target-watchers/legacy-workers-watcher"); // eslint-disable-next-line mozilla/reject-some-requires loader.lazyRequireGetter( this, "TargetFactory", "devtools/client/framework/target", true ); class TargetList extends EventEmitter { /** * This class helps managing, iterating over and listening for Targets. * * It exposes: * - the top level target, typically the main process target for the browser toolbox * or the browsing context target for a regular web toolbox * - target of remoted iframe, in case Fission is enabled and some