michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: "use strict"; michael@0: michael@0: module.metadata = { michael@0: "stability": "unstable" michael@0: }; michael@0: michael@0: const { events } = require("../window/events"); michael@0: const { filter } = require("../event/utils"); michael@0: const { isBrowser } = require("../window/utils"); michael@0: michael@0: // TODO: `isBrowser` detects weather window is a browser by checking michael@0: // `windowtype` attribute, which means that all 'open' events will be michael@0: // filtered out since document is not loaded yet. Maybe we can find a better michael@0: // implementation for `isBrowser`. Either way it's not really needed yet michael@0: // neither window tracker provides this event. michael@0: michael@0: exports.events = filter(events, function({target}) isBrowser(target));