View _ff-addon-snippet-winapi_setMouseHook.js
Cu.import('resource://gre/modules/ctypes.jsm');
var is64bit = ctypes.voidptr_t.size == 4 ? false : true;
var ifdef_UNICODE = true;
var TYPES = {
ABI: is64bit ? ctypes.default_abi : ctypes.winapi_abi,
CALLBACK_ABI: is64bit ? ctypes.default_abi : ctypes.stdcall_abi,
BOOL: ctypes.bool,
View bootstrap.js
const {interfaces: Ci, utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
const locationToMatch = 'mozillazine';
function addDiv(theDoc) {
//Cu.reportError('addDiv');
if (!theDoc) {
Cu.reportError('no theDoc!')
//document not provided, it is undefined likely
return;
View bootstrap.js
const {interfaces: Ci,utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
/*start - windowlistener*/
var windowListener = {
//DO NOT EDIT HERE
onOpenWindow: function (aXULWindow) {
// Wait for the window to finish loading
let aDOMWindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
aDOMWindow.addEventListener("load", function () {
View bootstrap.js
const {interfaces: Ci,utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
/*start - windowlistener*/
var windowListener = {
//DO NOT EDIT HERE
onOpenWindow: function (aXULWindow) {
// Wait for the window to finish loading
let aDOMWindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
aDOMWindow.addEventListener("load", function () {
View gist:8906220
const {Cc, Ci, Cu, components} = require('chrome');
Cu.import('resource://gre/modules/Services.jsm');
var utils = require("sdk/window/utils");
var tabs = require("sdk/tabs");
var self = require("sdk/self");
var data = self.data;
function createPanel() {
var winsize = tabs.activeTab.attach({
View cDumpNeo_bootstrap.js
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
const self = {
id: 'Bootstrap-Skeleton-Plus',
suffix: '@jetpack',
path: 'chrome://bootstrap-skeleton-plus/content/',
aData: 0,
};
const myServices = {};
Cu.import('resource://gre/modules/Services.jsm');
View _scratchpad-AlertWithinScratchpad
var spwin = Services.wm.getMostRecentWindow(null); //this gets the scratchpad window
var str = 'rawr';
var str = str[0].toUpperCase() + str.substr(1);
spwin.alert(str) // will upper case str this is just to demo the alert comes in the scratchpad window