Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Bug 921845 - Ensure unregistering the simulator on disabling/uninstallating #853

Merged
merged 1 commit into from Oct 21, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 10 additions & 14 deletions addon/lib/main.js
Expand Up @@ -3,6 +3,7 @@ const {Cc, Ci, Cu} = require("chrome");
const {SimulatorProcess} = require("./simulator-process"); const {SimulatorProcess} = require("./simulator-process");
const Promise = require("sdk/core/promise"); const Promise = require("sdk/core/promise");
const Self = require("sdk/self"); const Self = require("sdk/self");
const { Simulator } = Cu.import("resource://gre/modules/devtools/Simulator.jsm");


let process; let process;


Expand Down Expand Up @@ -32,17 +33,12 @@ function close() {
// expose various information about the runtime we ship // expose various information about the runtime we ship
let appinfo = JSON.parse(Self.data.load("appinfo.json")); let appinfo = JSON.parse(Self.data.load("appinfo.json"));


let Simulator; Simulator.register(appinfo.label, {
// Simulator module only landed in FF26, appinfo: appinfo,
// so do not throw on addon startup when we miss it launch: launch,
try { close: close
Simulator = Cu.import("resource://gre/modules/devtools/Simulator.jsm").Simulator; });
} catch(e) {}

require("sdk/system/unload").when(function () {
if (Simulator) { Simulator.unregister(appinfo.label);
Simulator.register(appinfo.label, { });
appinfo: appinfo,
launch: launch,
close: close
});
}