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: michael@0: const {Cu} = require("chrome"); michael@0: const ObservableObject = require("devtools/shared/observable-object"); michael@0: const {Simulator} = Cu.import("resource://gre/modules/devtools/Simulator.jsm"); michael@0: michael@0: let store = new ObservableObject({versions:[]}); michael@0: michael@0: function feedStore() { michael@0: store.object.versions = Simulator.availableVersions().map(v => { michael@0: return {version:v} michael@0: }); michael@0: } michael@0: michael@0: Simulator.on("register", feedStore); michael@0: Simulator.on("unregister", feedStore); michael@0: feedStore(); michael@0: michael@0: module.exports = store;