Skip to content

Instantly share code, notes, and snippets.

// -sp-context:browser
// Open this file in scratchpad and run it. Output goes to the Browser Console (Cmd-Shift-J).
Components.utils.import("resource://gre/modules/devtools/dbg-server.jsm");
Components.utils.import("resource://gre/modules/devtools/dbg-client.jsm");
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let { StyleSheetsFront } = devtools.require("devtools/server/actors/stylesheets");
let client;
// -sp-context:browser
Components.utils.import("resource://gre/modules/devtools/dbg-server.jsm");
Components.utils.import("resource://gre/modules/devtools/dbg-client.jsm");
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let { StyleSheetsFront } = devtools.require("devtools/server/actors/stylesheets");
let client;
function startDebugger()
{
// -sp-context:browser
// Dumps the event listeners defined in the content window of the current tab.
var Ci = Components.interfaces;
var Cc = Components.classes;
let eventListenerService = Cc["@mozilla.org/eventlistenerservice;1"]
.getService(Ci.nsIEventListenerService);
Cu.import("resource://gre/modules/jsdebugger.jsm");
addDebuggerToGlobal(this);
// -sp-context:browser
"use strict";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
Cu.import("resource://gre/modules/devtools/Console.jsm");
let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
let gMgr = Cc["@mozilla.org/memory-reporter-manager;1"]
@past
past / infinitest.sh
Created July 31, 2013 10:55
Run a test until it fails in order to reproduce an intermittent test failure.
#!/bin/bash
# Change MOZCONFIG to point to a different build configuration or comment it out to use the default.
export MOZCONFIG=.mozconfig-opt
declare -i count=0
result=0
while [ $result -eq 0 ]
do
# Modify the next line to specify the exact mach invocation that should be tried.
mach mochitest-browser browser/devtools/debugger/test/browser_dbg_event-listeners.js
#mach xpcshell-test -d toolkit/devtools/server/tests/unit/test_dbgsocket.js
@past
past / gist:5956055
Created July 9, 2013 09:38
SoundCloud certificate errors
Playing any sound on my SoundCloud stream produces lots of these messages in the Browser Console (using Firefox Nightly):
--
[12:27:33.210] Firefox can't establish a connection to the server at wss://pushers.soundcloud.com/. @ https://a2.sndcdn.com/assets/sc-NxAx-a2cb4b10.js:20
--
[12:27:39.916] pushers.soundcloud.com:443 uses an invalid security certificate.
The certificate expired on 13/5/13 4:42 μ.μ.. The current time is 9/7/13 12:27 μ.μ..
(Error code: sec_error_expired_certificate)
function Foo() {}
Foo.prototype.iterator = function() {
// yield 1;
// throw StopIteration;
}
var f = new Foo();
console.log([i for (i of f)]);
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("*");
diff --git a/toolkit/devtools/debugger/server/dbg-script-actors.js b/toolkit/devtools/debugger/server/dbg-script-actors.js
--- a/toolkit/devtools/debugger/server/dbg-script-actors.js
+++ b/toolkit/devtools/debugger/server/dbg-script-actors.js
@@ -502,6 +502,7 @@ ThreadActor.prototype = {
let breakpoints = this._breakpointStore[aLocation.url];
let actor;
+try {
if (breakpoints[aLocation.line].actor) {
actor = breakpoints[aLocation.line].actor;
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
ac_add_options --enable-debug
ac_add_options --enable-optimize
ac_add_options --enable-profiling
ac_add_options --with-ccache
ac_add_options --enable-chrome-format=symlink
CC=clang
CXX=clang++