Skip to content

Instantly share code, notes, and snippets.

View MikeRatcliffe's full-sized avatar
😁

Mike Ratcliffe MikeRatcliffe

😁
View GitHub Profile
In toolbox.js:
let Telemetry = require("devtools/shared/telemetry");
And in telemetry.js:
this.Telemetry = function Telemetry() {
this.logOncePerBrowserVersion = this.logOncePerBrowserVersion.bind(this);
this.logEvent = this.logEvent.bind(this);
this.logId = this.logId.bind(this);
this.log = this.log.bind(this);
};
var Ci = Components.interfaces;
var Cc = Components.classes;
let eventListenerService = Cc["@mozilla.org/eventlistenerservice;1"]
.getService(Ci.nsIEventListenerService);
let dbg = new Debugger();
let DOwindow = dbg.addDebuggee(content.window);
let nodes = content.window.document.querySelectorAll("*");
// Widgets are dumb UI implementations sharing a specific interface, which
// defines how interaction with their contents happen.
// The common interface is defined in the MenuContainer constructor
// documentation, in ViewHelpers.jsm (you really don't need to care about this
// if you're not actually writing a widget; furthermore, a <xul:menulist>
// implements all those methods by default, so it can be considered itself a
// widget).
// This is how it is, because it's redundant to write the same UI interaction
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_MAKE_FLAGS="-s --no-print-directory -j12"
mk_add_options AUTOCLOBBER=1
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-tests
ac_add_options --with-ccache
CC="clang -fcolor-diagnostics"
@MikeRatcliffe
MikeRatcliffe / gist:6070006
Created July 24, 2013 12:17
GCLI command file
[{
name: 'hello',
description: 'Show a message',
params: [
{
name: 'name',
type: 'string',
description: 'Who to say hello to',
}
],

So you want to write an actor

Starting out with primitive types

So you have an idea for a Firefox developer tool. You (obviously) want it to work on Fennec and Firefox OS, so it needs to use the remote debugging protocol. You have a backend:

function SimpleBackend() { }

SimpleBackend.prototype = {

However before you post a message on the forum and to speed up things, don't forget to include as much informations as you can (if it's possible ;) ):
* The version of Cairo-Dock ('cairo-dock -v' in a terminal).
cairo-dock -v
cairo-dock: Symbol `g_openglConfig' has different size in shared object, consider re-linking
cairo-dock: Symbol `myDocksParam' has different size in shared object, consider re-linking
3.2.1
* Your GNU/Linux distribution (Debian, Ubuntu, Fedora, etc.).
Fedora 19
let rootContainer = this.getContainer(this._rootNode);
rootContainer.childrenDirty = true;
this._updateChildren(rootContainer);
@MikeRatcliffe
MikeRatcliffe / gist:6522030
Last active December 22, 2015 19:49
Disable cache
let docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docShell.defaultLoadFlags = Ci.nsIRequest.LOAD_BYPASS_CACHE |
Ci.nsIRequest.INHIBIT_CACHING;
window.location.reload(true);
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that disabling JavaScript for a tab works as it should.
const TEST_URI = "http://mochi.test:8888/browser/browser/devtools/framework/" +
"test/browser_toolbox_options_disable_cache.html";
let doc;
let toolbox;