Bug 1066816 - Allow OT toolkit to set GUID for analytics r=Standard8

This commit is contained in:
Adam Roach [:abr] 2014-09-16 06:46:11 -07:00
parent a70326e54f
commit 0433e14606
2 changed files with 28 additions and 0 deletions

View File

@ -455,6 +455,20 @@ loop.conversation = (function(OT, mozL10n) {
// else to ensure the L10n environment is setup correctly.
mozL10n.initialize(navigator.mozLoop);
// Plug in an alternate client ID mechanism, as localStorage and cookies
// don't work in the conversation window
if (OT && OT.hasOwnProperty("overrideGuidStorage")) {
OT.overrideGuidStorage({
get: function(callback) {
callback(null, navigator.mozLoop.getLoopCharPref("ot.guid"));
},
set: function(guid, callback) {
navigator.mozLoop.setLoopCharPref("ot.guid", guid);
callback(null);
}
});
}
document.title = mozL10n.get("incoming_call_title2");
document.body.classList.add(loop.shared.utils.getTargetPlatform());

View File

@ -455,6 +455,20 @@ loop.conversation = (function(OT, mozL10n) {
// else to ensure the L10n environment is setup correctly.
mozL10n.initialize(navigator.mozLoop);
// Plug in an alternate client ID mechanism, as localStorage and cookies
// don't work in the conversation window
if (OT && OT.hasOwnProperty("overrideGuidStorage")) {
OT.overrideGuidStorage({
get: function(callback) {
callback(null, navigator.mozLoop.getLoopCharPref("ot.guid"));
},
set: function(guid, callback) {
navigator.mozLoop.setLoopCharPref("ot.guid", guid);
callback(null);
}
});
}
document.title = mozL10n.get("incoming_call_title2");
document.body.classList.add(loop.shared.utils.getTargetPlatform());