events.js 823 B

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