Skip to content

Instantly share code, notes, and snippets.

View wordlist.js
var words = ["a",
"abilities",
"ability",
"abilitys",
"able",
"about",
"above",
"absence",
"absolute",
"absolutely",
View gist:8846311

What

A proposal for updating our style inspector and style editor.

For now it is a rough draft put together quickly. It will need to be refined a lot and will require discussions and, later, should be turned into a plan with bugs being filed.

Many of the things described below already work this way today, I just haven't had the chance yet to describe them as such. A list highlighting what exists today, what doesn't and what should be changed has yet to be created.

Why

To achieve 2 main goals:

View storage-test.js
/**
* Open Browser Toolbox after building your Nightly with the patch from bug 965872 applied.
* Go to Scratchpad Tab
* Run this script
*/
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let { require } = devtools;
let {StorageFront} = require("devtools/server/actors/storage");
@grssam
grssam / CSSPropertyValueScratchpad.js
Created Jul 29, 2013
Run this script in Scratchpad in Latest Nightly to get a key-value pair of all the prefix-free properties vs their possible standard values.
View CSSPropertyValueScratchpad.js
/* -sp-context: browser */
let domUtils = Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils)
let properties = {};
domUtils.getCSSPropertyNames(domUtils.INCLUDE_ALIASES)
.sort()
.filter(x=>!x.startsWith("-moz"))
.forEach(x=> {
properties[x] = domUtils.getCSSValuesForProperty(x)
.sort()
.filter(x=>!x.startsWith("-moz"));
@grssam
grssam / index.html
Last active Dec 19, 2015
A CodePen by Girish Sharma. Metro-like loading animation with CSS3 - Prefix-free loading animation, inspired by Metro and Windows 8
View index.html
<div class="loader more">
</div>
@grssam
grssam / index.html
Created Jul 3, 2013
A CodePen by Girish Sharma. Metro-like loading animation with CSS3 - Prefix-free loading animation, inspired by Metro and Windows 8
View index.html
<div class="loader">
</div>
@grssam
grssam / overloadedArguments.js
Created Jun 21, 2013
Arguments Overloading FTW
View overloadedArguments.js
/**
* Converts any input box on a page to a CSS selector search and suggestion box.
*
* @constructor
* @param {nsIDOMDocument} aContentDocument
* The content document which inspector is attached to.
* @param {nsiInputElement|String} aInputNode
* The input element or the selector for teh input element to which the
* panel will be attached and from where search input will be taken.
* @param {Object} aOptions
@grssam
grssam / scratchpad.js
Created Feb 15, 2013
trying to select the doctype element
View scratchpad.js
let tempScope = {};
Components.utils.import("resource:///modules/devtools/Target.jsm", tempScope);
let TargetFactory = tempScope.TargetFactory;
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target).then(function(toolbox) {
toolbox.selectTool("inspector").then(function(inspector) {
inspector.selection.setNode(window.content.document.doctype);
});
});
@grssam
grssam / background.js
Created Nov 2, 2012
Get the background color from an image.
View background.js
/**
* Function to get the background color from an image.
* Its just one of the various approaches to get the result.
* Works for most of the cases and should be fast.
* It is advised to perform this kind of computation from a worker.
*
* @param imgEl [object HTMLImageElement]
* The image object for which background is needed.
* @param aDoc [object HTMLDocument]
* The document object.
View test.diff
# HG changeset patch
# User Girish Sharma <scrapmachines@gmail.com>
# Date 1347637171 -19800
# Node ID da31829c11c69e85a392a4161f6167c6e2297f94
# Parent a97775b456cf873ca6f809e03ff62e02028e7fe0
[mq]: scratchpad
diff --git a/browser/devtools/webconsole/HUDService.jsm b/browser/devtools/webconsole/HUDService.jsm
--- a/browser/devtools/webconsole/HUDService.jsm
+++ b/browser/devtools/webconsole/HUDService.jsm