Skip to content

Instantly share code, notes, and snippets.

"use strict";
function install(data, reason) {}
function uninstall(data, reason) {}
function startup(data, reason) {}
function shutdown(data, reason) {}
/* vim:set ts=2 sw=2 sts=2 expandtab */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
@ochameau
ochameau / notification.js
Created April 27, 2012 17:07 — forked from gregglind/notification.js
example notifcationbox addon
"use strict";
const observer = require("observer-service");
const tabs = require("tabs");
const widgets = require("widget");
const { WindowTracker, isBrowser } = require('api-utils/window-utils');
var widget = widgets.Widget({
id: "mozilla-link",
label: "Mozilla website",
@ochameau
ochameau / process-logs.js
Created February 9, 2017 18:13
Progress git log to compute some data about devtools bugs
var git = "git log --numstat --format=oneline --grep '^Bug '";
function execCommand(cmd, callback) {
const exec = require('child_process').exec;
exec(cmd, {maxBuffer:10000000}, (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
callback(stdout);
diff --git a/devtools/client/devtools-startup.js b/devtools/client/devtools-startup.js
index 4feb75d..3e34e1d 100644
--- a/devtools/client/devtools-startup.js
+++ b/devtools/client/devtools-startup.js
@@ -25,7 +25,8 @@ function DevToolsStartup() {}
DevToolsStartup.prototype = {
handle: function (cmdLine) {
- let consoleFlag = cmdLine.handleFlag("jsconsole", false);
+ let consoleFlag = cmdLine.handleFlag("jsconsole", false) ||
commit 816bb258dfd315b5c2385e4ced6ac2e6a91b5c4f
Author: Alexandre Poirot <[email protected]>
Date: Wed Jun 20 14:28:06 2018 -0700
refactor shader editor initializer.
MozReview-Commit-ID: sLVVmv8ZUF
diff --git a/devtools/client/definitions.js b/devtools/client/definitions.js
index 75dd62686eb67..c2552eccb9d9f 100644
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Components.utils.import("resource://gre/modules/osfile.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
var done = false;
let gPaths = arguments.filter(a => !a.startsWith("-"));
if (!gPaths.length) {
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Components.utils.import("resource://gre/modules/osfile.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
var done = false;
let gPaths = arguments.filter(a => !a.startsWith("-"));
if (!gPaths.length) {
@ochameau
ochameau / compartment.patch
Created November 15, 2018 18:22
use document global/compartment for browser loader modules
diff --git a/devtools/shared/base-loader.js b/devtools/shared/base-loader.js
index 4fde5d7d7fa1..455e86ee2f42 100644
--- a/devtools/shared/base-loader.js
+++ b/devtools/shared/base-loader.js
@@ -198,23 +198,15 @@ function load(loader, module) {
configurable: true,
value: lazyRequireModule.bind(sandbox),
};
+ Object.defineProperties(sandbox, descriptors);
@ochameau
ochameau / pjs-rewrite.sh
Created December 5, 2018 09:32
front rewrite script
#!/bin/bash
FOLDER=devtools/shared/fronts
if [ ! -z "$1" ]; then
FOLDER=$1
fi
echo $FOLDER
set -x
### Get rid of "protocol" symbol and import protocol.js symbols individually