Created
February 21, 2013 21:39
-
-
Save ilanasegall/5008504 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////GIVE UNIQUE ID, firstname | |
"use strict"; | |
let obs_svc = require("observer-service"); | |
let {prefs} = require("simple-prefs"); | |
let tabs = require("tabs") | |
prefs["logtoconsole"] = true; | |
prefs["sdk.console.logLevel"] = 0; | |
tabs.open("chrome://global/content/console.xul") | |
let mtp = require("./micropilot").Micropilot('ctp-micropilot'); | |
mtp.start() | |
//test - has the addon started? | |
mtp.record({msg:"We're recording!",data:"datablob",ts:Date.now()}); | |
//all ctp topics | |
let topics = ['clicktoplay-instance-created', 'clicktoplay-instance-started', | |
'clicktoplay-instance-stopped', 'clicktoplay-inpage-activate', 'clicktoplay-inpage-settings', | |
'clicktoplay-inpage-close', 'clicktoplay-inpage-context', 'clicktoplay-inpage-context-activate', | |
'clicktoplay-inpage-context-close', 'clicktoplay-doorhanger-icon', 'clicktoplay-doorhanger-dropdown', | |
'clicktoplay-doorhanger-activate', 'clicktoplay-doorhanger-activeateall', | |
'clicktoplay-doorhanger-activatealways', 'clicktoplay-doorhanger-activatenever', | |
'clicktoplay-instance-scripted', 'flashplugin-perfstats', 'plugin-started', | |
'plugin-stopped', 'plugin-crashed-log', 'plugin-crash-submitted']; | |
topics.forEach( | |
function(t){ | |
obs_svc.add(t, function(subj, data){ | |
mtp.record({msg:t,data:data,ts:Date.now()}) | |
}) | |
}) | |
/*mtp.data().then( | |
function(data) { | |
console.log(JSON.stringify(data,null,2)); | |
} | |
)*/ | |
mtp.lifetime(3000).then(function(mtp){ | |
console.log("entered fn"); | |
mtp.data().then( | |
function(data) { | |
console.log(JSON.stringify(data,null,2)); | |
} | |
); | |
}) | |
/*mtp.lifetime(3000).then(function(recorded_data){ | |
console.log(JSON.stringify(recorded_data,null,2)); | |
recorded_data.ezupload(); | |
//recorded_data.ezupload({url:"http://mango-gw.mango.metrics.scl3.mozilla.com", interval: 10, killaddon:true}); | |
})*/ | |
//test - can we write to global observer service and pick up the message? | |
//obs_svc.notify('final-ui-startup', 'Passed a message on final-ui-startup!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment