Skip to content

Instantly share code, notes, and snippets.

function getFont(element) {
// create canvas in owner doc to get @font-face fonts
var doc = element.ownerDocument;
var canvas = doc.createElement("canvas");
var context = canvas.getContext("2d");
if(!context.measureText)
return "Text";
var style = doc.defaultView.getComputedStyle(element, null);
function allStyleSheets(doc) {
var stylesheets = [];
for(var i = 0; i < doc.styleSheets.length; i++)
stylesheets = stylesheets.concat(getStyleSheets(doc.styleSheets[i]));
return stylesheets;
}
function getStyleSheets(stylesheet) {
if(!stylesheet)
return []; // Firefox protects against @import statement loops
import httplib
import json
result = {
"firefox": {
"build_id": "20100401064631",
"version": "3.6.3"
},
"run_id": 0,
"timestamp": 1279376772,
properties of jquery couchdb's 'db' object:
name
uri
compact
viewCleanup
compactView
create
drop
info
changes
diff --git a/Users/harth/jetpack-sdk/packages/jetpack-core/lib/securable-module.js b/mozmill/mozmill/extension/resource/modules/securable-module.js
index 57173a9..794c3e2 100644
--- a/Users/harth/jetpack-sdk/packages/jetpack-core/lib/securable-module.js
+++ b/mozmill/mozmill/extension/resource/modules/securable-module.js
@@ -204,7 +204,6 @@
};
return chrome;
}
-
var path = self.fs.resolveModule(rootDir, module);
Components.utils.import("resource://gre/modules/ctypes.jsm");
var EXPORTED_SYMBOLS = ["open"];
nspr = ctypes.open('/Applications/Minefield.app/Contents/MacOS/libnspr4.dylib');
var PR_AF_INET = 2;
var port = 2387;
/*
Turns CommonJS package into a browser file.
Minifying requires UglifyJS (http://github.com/mishoo/UglifyJS)
to be in the dir above this one.
uses node-jake http://github.com/mde/node-jake
run with 'jake [build|minify|clean]'
*/
var fs = require("fs"),
path = require("path"),
diff --git a/mozmill/mozmill/extension/resource/modules/controller.js b/mozmill/mozmill/extension/resource/modules/controller.js
index ffd8467..64f5ea3 100644
--- a/mozmill/mozmill/extension/resource/modules/controller.js
+++ b/mozmill/mozmill/extension/resource/modules/controller.js
@@ -100,47 +100,6 @@ waitForEvents.prototype = {
}
}
-/**
- * Dynamically create hierarchy of available menu entries
@harthur
harthur / modal_dialog.diff
Created November 22, 2010 21:54
Mozmill modal dialog shared module refactor
# HG changeset patch
# Parent 6585aa4bca819847388eb3ea0e43622b0f9739e0
# User Henrik Skupin <[email protected]>
Bug 560820 - Refactor modal dialog to lower count of test failures. r=ctalbert
diff --git a/shared-modules/modal-dialog.js b/shared-modules/modal-dialog.js
--- a/shared-modules/modal-dialog.js
+++ b/shared-modules/modal-dialog.js
@@ -42,144 +42,101 @@
*
@harthur
harthur / dnd.js
Created December 7, 2010 01:38
mozmill drag and drop shared module WIP
var EventUtils = {}; Components.utils.import('resource://mozmill/stdlib/EventUtils.js', EventUtils);
var dragBy = function(element, offsetX, offsetY, contentWindow) {
var rect = element.getBoundingClientRect();
var startX = (rect.right - rect.left)/2;
var startY = (rect.bottom - rect.top)/2;
var incrementX = offsetX / 2;
var incrementY = offsetY / 2;
EventUtils.synthesizeMouse(