only use our experimentPing outside of Test Pilot
This commit is contained in:
parent
3700e6f461
commit
5916bd2871
2 changed files with 8 additions and 16 deletions
|
@ -82,21 +82,14 @@ function experimentPing(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Experiment() {
|
function Experiment() {
|
||||||
|
// If the user has @testpilot-addon, it already bound
|
||||||
|
// experimentPing to testpilot::send-metric,
|
||||||
|
// so we don't need to bind this one
|
||||||
|
AddonManager.getAddonByID('@testpilot-addon', addon => {
|
||||||
|
if (!addon) {
|
||||||
Events.on(EVENT_SEND_METRIC, experimentPing);
|
Events.on(EVENT_SEND_METRIC, experimentPing);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Experiment.prototype = {
|
|
||||||
constructor: function() {
|
|
||||||
Events.on(EVENT_SEND_METRIC, experimentPing);
|
|
||||||
},
|
|
||||||
|
|
||||||
ping: function(event) {
|
|
||||||
experimentPing(event);
|
|
||||||
},
|
|
||||||
|
|
||||||
teardown: function() {
|
|
||||||
Events.off(EVENT_SEND_METRIC, experimentPing);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = Experiment;
|
module.exports = Experiment;
|
||||||
|
|
|
@ -173,7 +173,6 @@ Metrics.prototype = {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log("notifying observerser of testpilot::send-metric; subject: ", subject, " stringified: ", stringified);
|
|
||||||
Services.obs.notifyObservers(subject, 'testpilot::send-metric', stringified);
|
Services.obs.notifyObservers(subject, 'testpilot::send-metric', stringified);
|
||||||
this._log(`Sent client message via nsIObserverService: ${stringified}`);
|
this._log(`Sent client message via nsIObserverService: ${stringified}`);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue