Skip to content

Instantly share code, notes, and snippets.

@jeffgca
jeffgca / addhelper.js
Created April 10, 2015 18:38
add helper
const { Cc, Ci, Cu, Cr, Cm, components } = require('chrome');
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const { WebConsoleCommands } = devtools.require("devtools/toolkit/webconsole/utils");
let { ActionButton } = require("sdk/ui/button/action");
let button = ActionButton({
id: "my-button-id",
label: "Add Console Helper",
icon: {
@jeffgca
jeffgca / Uservoice.json
Last active August 29, 2015 14:18
Polish bugs
[
[
"Ability to filter network tab data",
"https://ffdevtools.uservoice.com/forums/246087-firefox-developer-tools-ideas/suggestions/6656793-ability-to-filter-network-tab-data"
],
[
"View Source in a tab",
"https://ffdevtools.uservoice.com/forums/246087-firefox-developer-tools-ideas/suggestions/5895550-view-source-in-a-tab"
],
[
@jeffgca
jeffgca / trigger-gcli.js
Created February 25, 2015 02:37
Node / Firefox commands proposal
var FirefoxClient = require("firefox-client");
var client = new FirefoxClient(),
path = '~/tmp/',
options = {};
client.connect(6000, function() {
var arguments = {
path: path,
options: options
};
@jeffgca
jeffgca / tooldefinition.js
Last active August 29, 2015 14:15
tooldefinition globals injection
"use strict";
const { Cc, Ci, Cu, Cr } = require('chrome');
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/devtools/gDevTools.jsm");
const { setTimeout, clearTimeout } = require('sdk/timers');
const ZestRunner = require('zest-runner');
@jeffgca
jeffgca / jpm-build.sh
Created January 5, 2015 19:10
jpm-build.sh
#!/bin/bash
JPM=/usr/local/bin/jpm
if [ -z "$1" ]; then
URL="http://127.0.0.1:8888/"
else
URL="http://127.0.0.1:$1/"
fi
@jeffgca
jeffgca / foo.xml
Created December 16, 2014 18:50
sample.rdf
<?xml version="1.0" encoding="utf-8"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>@bztodo</em:id>
<em:version>0.0.2</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:unpack>false</em:unpack>
<em:name>Bugzilla Request Flags</em:name>
<em:homepageURL/>
@jeffgca
jeffgca / jpinstall.sh
Created November 18, 2014 17:31
jpm jpinstall
#!/bin/bash
JPM=/usr/local/bin/jpm
if [ -z "$1" ]; then
URL="http://127.0.0.1:8888/"
else
URL="http://127.0.0.1:$1/"
fi
@jeffgca
jeffgca / error.sh
Created November 6, 2014 19:47
inspector error
11:47:08.645 A promise chain failed to handle a rejection. Did you forget to '.catch', or did you forget to 'return'?
See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise
Date: Thu Nov 06 2014 11:47:00 GMT-0800 (PST)
Full Message: TypeError: source is not an object
Full Stack: merge@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/object.js:43:10
NodeFront<.form@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/inspector.js:739:18
types.addActorType/type<.read@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/protocol.js:282:7
exports.WalkerFront<.frontForRawNode@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/inspector.js:2866:22
Selection.prototype.setNode@resource://gre/modules/commonjs/toolkit/loader.js -> resource:///modules/devtools/framework/selection.js:136:1
@jeffgca
jeffgca / getWs.js
Created October 16, 2014 20:11
Get a WebSocket to use.
let utils = require('sdk/window/utils');
let { defer } = require('sdk/core/promise');
function getWs(callback) {
// note, this will get slow or possibly break when Firefox goes multi-process...
let WebSocket = utils.getMostRecentBrowserWindow().content.WebSocket;
if (callback) {
callback(null, WebSocket);
} else {