worker.js 497 B

1234567891011121314151617
  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. const ContentWorker = require('../content/worker').Worker;
  6. function Worker(options, window) {
  7. options.window = window;
  8. let worker = ContentWorker(options);
  9. worker.once("detach", function detach() {
  10. worker.destroy();
  11. });
  12. return worker;
  13. }
  14. exports.Worker = Worker;