Created
January 15, 2013 17:49
-
-
Save anonymous/4540452 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* an api for adding soemthing to the developer toolbar | |
*/ | |
var devtool = require('devtools/toolbar').Tool({ | |
label: 'My Dev Tool', | |
contentURL: self.data.url('index.html'), | |
contentScritpFile: self.data.url('tool.js') | |
onOpen: function(worker) { | |
worker.on('x', y); // etc. | |
} | |
}); | |
/** | |
* an api for creating a custom logging channel in the gobal console | |
* firePHPConsole has the same methods as console eg log, warn, etc | |
* see: https://developer.mozilla.org/en-US/docs/DOM/console | |
*/ | |
function firePHPParser(raw) { | |
// ...etc | |
return parsed; | |
} | |
var firePHPConsole = require('devtools/console').Console({ | |
label: 'FirePHP', | |
parser: firePHPParser, | |
scope: 'tab' // or global | |
}); | |
var firePHP = require('page-mod').PageMod({ /* etc */ | |
contentScriptFile: self.data.url('parser.js'), | |
onAttach: function(worker) { | |
worker.on('firePHP', function(message) { | |
firePHPConsole.log('') | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment