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': 'stable', michael@0: 'engines': { michael@0: 'Firefox': '*', michael@0: 'Fennec': '*' michael@0: } michael@0: }; michael@0: michael@0: const { isBrowser } = require('./window/utils'); michael@0: const { modelFor } = require('./model/core'); michael@0: const { viewFor } = require('./view/core'); michael@0: michael@0: michael@0: if (require('./system/xul-app').is('Fennec')) { michael@0: module.exports = require('./windows/fennec'); michael@0: } michael@0: else { michael@0: module.exports = require('./windows/firefox'); michael@0: } michael@0: michael@0: michael@0: const browsers = module.exports.browserWindows; michael@0: michael@0: // michael@0: modelFor.when(isBrowser, view => { michael@0: for (let model of browsers) { michael@0: if (viewFor(model) === view) michael@0: return model; michael@0: } michael@0: return null; michael@0: });