Skip to content

Instantly share code, notes, and snippets.

View robcee's full-sized avatar
🌶️
one million scovilles

Rob Campbell robcee

🌶️
one million scovilles
View GitHub Profile

Web Console output rewrite, bug 778766

This document describes the ongoing work for the Web Console output rewrite / reimplementation. Feedback is requested.

WORK IN PROGRESS!

Current issues

Issues currently affecting the Web Console output:

  • page navigation/reload issues:
diff --git a/browser/devtools/scratchpad/scratchpad.js b/browser/devtools/scratchpad/scratchpad.js
--- a/browser/devtools/scratchpad/scratchpad.js
+++ b/browser/devtools/scratchpad/scratchpad.js
@@ -23,19 +23,22 @@ Cu.import("resource://gre/modules/Servic
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource:///modules/PropertyPanel.jsm");
Cu.import("resource:///modules/source-editor.jsm");
Cu.import("resource:///modules/devtools/LayoutHelpers.jsm");
Cu.import("resource:///modules/devtools/scratchpad-manager.jsm");
Cu.import("resource://gre/modules/jsdebugger.jsm");
/*
* This Scratchpad will poll the Google Play Store every hour and
* look for the words "Sold Out" in their banner div. If they're
* not there, you'll get an alert that it's in!
*
* This Scratchpad needs to run in Browser Context!
* https://developer.mozilla.org/en-US/docs/Tools/Scratchpad#Using_Scratchpad_to_access_Firefox_internals
*/
var duration = 1000 * 60 * 60; // ms * sec * min = 1 hour
/*
* This is a JavaScript Scratchpad.
*
* Enter some JavaScript, then Right Click or choose from the Execute Menu:
* 1. Run to evaluate the selected text (Ctrl+R),
* 2. Inspect to bring up an Object Inspector on the result (Ctrl+I), or,
* 3. Display to insert the result in a comment after the selection. (Ctrl+L)
*/
Components.utils.import("resource://gre/modules/osfile.jsm");
@robcee
robcee / postToAppNet.js
Created October 1, 2012 15:35
Scratch-kit Scratchpad to post to App.net
var currentTab = require('tabs').activeTab;
var url = currentTab.url; // get the location.
var title = currentTab.title;
var appscript = "self.port.on('update', function _update() {" +
" console.log('hi');" +
" document.querySelector('div.navbar').setAttribute('hidden', 'true'); " +
" document.querySelector('div.hero-unit').setAttribute('hidden', 'true'); " +
" document.querySelector('div.post-stream').setAttribute('hidden', 'true'); " +
" let newPost = document.querySelector('textarea.editable.input-flex');" +
@robcee
robcee / remote.js
Created August 16, 2012 15:27
Creating a remote debugger server
/**
* Creating a remote debugger server.
*/
Cu.import("resource://gre/modules/devtools/dbg-server.jsm");
if (!DebuggerServer.initialized) {
DebuggerServer.init(function() true);
DebuggerServer.addBrowserActors();
}
DebuggerServer.closeListener();
// GCLI Browser Scratchpad
// via https://bugzilla.mozilla.org/show_bug.cgi?id=724055#c7
// gBrowser.ownerDocument.defaultView.Scratchpad.openScratchpad()
Cu.import("resource:///modules/devtools/gcli.jsm");
gcli.addCommand({
name: "scratchpad",
description: "Commands to open a Scratchpad"
});
@robcee
robcee / getChannelList.js
Created May 29, 2012 16:07
getChannelList
exports.getChannelList = function(client, io, callback) {
client.keys('channels:*', function(err, channels) {
try {
var channelList = [];
var counter = 0;
function getFunc(errChannel, channel) {
var channelHash = {
name: channel,
userCount: io.sockets.clients(channel).length
@robcee
robcee / quotes
Created May 28, 2012 13:36 — forked from paulrouget/quotes
What robcee says
<robcee> where's my hat?,
-------
<robcee> u r teh smartest,
-------
<robcee> I WILL TAKE THIS BULLET FOR YOU,
-------
* robcee swears violently
* robcee continues swearing,
-------
<robcee> hey everybody, forget email. Let's all go skiing. (toboggans also acceptable),
@robcee
robcee / .mozconfig
Created April 27, 2012 16:19
.mozconfig
# This file specifies the build flags for Firefox. You can use it by adding:
# . $topsrcdir/browser/config/mozconfig
# to the top of your mozconfig file.
mk_add_options AUTOCONF=/usr/local/Cellar/autoconf213/2.13/bin/autoconf213
mk_add_options MOZ_MAKE_FLAGS="-s -j4"
ac_add_options --enable-application=browser
ac_add_options --enable-optimize
#ac_add_options --enable-debug