Skip to content

Instantly share code, notes, and snippets.

function decorate(func) {
return func();
}
function Foo(name) {
this.name = name;
}
Foo.prototype = {
@joewalker
joewalker / xulcommand.js
Created July 4, 2012 18:31
Bug 767900 - GCLI needs a command to enable execution of XUL Commands
Components.utils.import("resource:///modules/devtools/gcli.jsm");
gcli.addCommand({
name: 'xulcommand',
description: 'Run a XUL Command',
params: [
{
name: 'command',
type: {
Components.utils.import("resource:///modules/devtools/gcli.jsm");
gcli.addCommand({
name: 'foo',
params: [
{
name: 'letters',
type: {
name: 'selection',
Components.utils.import("resource:///modules/devtools/gcli.jsm");
gcli.addCommand({
name: 'foo',
params: [
{
name: 'letters',
type: {
name: 'selection',
@joewalker
joewalker / gist:2995951
Created June 26, 2012 14:01
createView
Basic use of createView
gcli.addCommand({
name: 'foo',
exec: function(args, context) {
return context.createView({
html: '<div>${name}</div>',
data: { name: 'joe' }
});
@joewalker
joewalker / hello.mozcmd
Created June 22, 2012 11:02
Basic 'hello' command using mozcmd
[
{
name: 'hello',
description: 'Show a message',
params: [
{
name: 'name',
type: 'string',
description: 'Who to say hello to',
}
@joewalker
joewalker / gist:2944434
Created June 17, 2012 12:35 — forked from anonymous/gist:2661058
Micro Debugger Demo
var debuggr = new Debugger(gBrowser.selectedBrowser.contentWindow);
debuggr.onEnterFrame = function(frame) {
alert(frame.callee.name + "(" + frame.arguments.join(", ") + ")");
};
@joewalker
joewalker / scratchpad.js
Created June 17, 2012 12:15 — forked from paulrouget/scratchpad.js
Firefox Magnifier
/*
TODO:
- zoom level menu
- need to find a way to re-start the update
- add color tools
- integrate better in Firefox
- crosshair has a 1px offset
*/
@joewalker
joewalker / browser_gcli_break.js
Created April 9, 2012 12:11
browser_gcli_break.js
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the break command works as it should
const TEST_URI = "http://example.com/browser/browser/devtools/shared/test/browser_gcli_break.html";
function test() {
DeveloperToolbarTest.test(TEST_URI, function(browser, tab) {
testBreakCommands();