Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onRequest: function(request, response) {
try {
// All the editor content is located under 'edit:///' so to get a path
// we just strip that out.
var path = request.uri.replace('edit:///', '')
// If requested path was diff from 'edit:///...', then we load editor.
path = ~path.indexOf('edit:') ? 'index.html' : path
response.uri = data.url(path)
} catch(error) {
console.exception(error)
}
}
}).register()
// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const {Cc,Ci,Cu} = require("chrome");
let main = require("main");
let data = require("self").data;
let cmdRunnerModule = Cu.import(data.url("CmdRunner.jsm"));
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
function RemoteHost(options, cb, error_cb) {
this._adbCommand = "adb";
this._addr2lineCommand = "addr2line";
this._systemLibCache = "/tmp/";
this._fennecLibCache = "/tmp/";
this._serial = options.serial;
if (options.serial) {
this._adbCommand = "adb -s " + options.serial;
}
if (options.addr2lineCommand) {
this._addr2lineCommand = options.addr2lineCommand;
var OLD_UI_URL = "http://varium.fantasytalesonline.com/cleopatra/";
var DEFAULT_UI_URL = "http://people.mozilla.com/~bgirard/cleopatra/";
//var DEFAULT_UI_URL = "file:///Users/bgirard/ben/sps/cleopatra/index.html";
//var DEFAULT_UI_URL = "http://localhost/~markus/cleopatra/";
var DEFAULT_PROFILE_FORMAT = "string"; // or json
//var DEFAULT_PROFILE_FORMAT = "json";
let remote = require("remote");
let prefs = require("prefs");
let data = require("self").data;
let clipboard = require("clipboard");
let timers = require("timers");
let tabs = require("tabs");
let Request = require("request").Request;
let symbolicateModule = Cu.import(data.url("SymbolicateModule.jsm"));
let cmdRunnerModule = Cu.import(data.url("CmdRunner.jsm"));
var profiler = null;
var profilerFeatures = [];
var featuresToUse = [];
var startedWithFeatures = [];
var spsWidget = null;
var panel = null;
var c = 0;
var settingsTab = null;
var settingsTabPort = null;
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
onClick: function() {
if (typeof(tabs.activeTab._worker) == "undefined") {
let worker = tabs.activeTab.attach({
contentScriptFile: data.url('alertbot.js')
});
tabs.activeTab._worker = worker;
}
tabs.activeTab._worker.port.emit('alert', _("str_hello_world"));
}
});
function OpenGadgetWindow()
{
var panel=require("panel").Panel({
width: 800,
height: 600,
contentURL: data.url("gadget.html"),
contentScriptFile: data.url("gadget.js")
});
panel.show();
panel.port.emit("default",storage.gadget);
panel.port.on("apply",function(gadget){
storage.gadget=gadget;
});
}
function SaveImage(imageurl)
function OpenStyleWindow()
{
var panel=require("panel").Panel({
width: 800,
height: 600,
contentURL: data.url("styles.html"),
contentScriptFile: data.url("styles.js")
});
panel.show();
panel.port.emit("default",storage.colorHeader,storage.backgroundImage,storage.notificationsColor);
panel.port.on("apply",function(colorHeader,backgroundImage,notificationsColor){
storage.colorHeader=colorHeader;
storage.backgroundImage=backgroundImage;
storage.notificationsColor=notificationsColor;
});
}
function OpenGadgetWindow()
function OpenStyleWindow()
{
var panel=require("panel").Panel({
width: 800,
height: 600,
contentURL: data.url("styles.html"),
contentScriptFile: data.url("styles.js")
});
panel.show();
panel.port.emit("default",storage.colorHeader,storage.backgroundImage,storage.notificationsColor);
panel.port.on("apply",function(colorHeader,backgroundImage,notificationsColor){
storage.colorHeader=colorHeader;
storage.backgroundImage=backgroundImage;
storage.notificationsColor=notificationsColor;
});
}
function OpenGadgetWindow()
onClick: function() {
console.log("Widget got onClick");
let panel = panels.Panel({
height:150,
width:640,
contentURL: data.url("dock.html"),
contentScriptFile: data.url("dock.js"),
contentScript: "let gApplications = " + JSON.stringify(listFunc()),
onMessage: function(req) {}
});
openPanelOnLocationBar(panel);
}
});
widget.port.on('left-click', function() {
console.log('activate/deactivate');
widget.contentURL = toggleActivation() ?
data.url('widget/pencil-on.png') :
data.url('widget/pencil-off.png');
});
exports.main = function() {
pageMod.PageMod({
include: ["*"],
contentScriptFile: data.url("utm.js"),
contentScriptWhen: "start",
attachTo: ["existing", "top"]
})
}