Skip to content

Commit

Permalink
Fix module paths (bug 912121)
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed Sep 24, 2015
1 parent 5493ff4 commit 8ccebfe
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
31 changes: 24 additions & 7 deletions lib/pixel-perfect-actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,36 @@

const { Cu } = require("chrome");

// Remote Debugging Protocol API
const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const protocol = devtools["require"]("devtools/server/protocol");
const { method, RetVal, ActorClass, Actor, Arg } = protocol;
// Add-on SDK
const Events = require("sdk/event/core");
const DomEvents = require("sdk/dom/events");
const { makeInfallible } = devtools["require"]("devtools/toolkit/DevToolsUtils.js");

const { setTimeout, clearTimeout } = require("sdk/timers");

// Platform
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
const currentBrowserVersion = Services.appinfo.platformVersion;

// DevTools
// See also: https://bugzilla.mozilla.org/show_bug.cgi?id=912121
var devtools;
try {
devtools = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {}).devtools;
} catch (err) {
devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
}

var DevToolsUtils;
try {
DevToolsUtils = devtools["require"]("devtools/shared/DevToolsUtils");
} catch (err) {
DevToolsUtils = devtools["require"]("devtools/toolkit/DevToolsUtils");
}

const { DebuggerServer } = devtools["require"]("devtools/server/main");
const protocol = devtools["require"]("devtools/server/protocol");
const { method, RetVal, ActorClass, Actor, Arg } = protocol;
const makeInfallible = DevToolsUtils.makeInfallible;

// For debugging purposes. Note that the tracing module isn't available
// on the backend (in case of remote device debugging).
// const baseUrl = "resource://pixelperfectplugin-at-openhouseconcepts-dot-com/";
Expand Down
2 changes: 1 addition & 1 deletion lib/pixel-perfect-front.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { Trace, TraceError } = require("firebug.sdk/lib/core/trace.js").get(modul
const { PixelPerfectActor } = require("./pixel-perfect-actor.js");
const Events = require("sdk/event/core");

const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const { devtools } = require("firebug.sdk/lib/core/devtools.js");
const { Front, FrontClass } = devtools["require"]("devtools/server/protocol");

/**
Expand Down
3 changes: 1 addition & 2 deletions lib/pixel-perfect-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ const { Win } = require("firebug.sdk/lib/core/window.js");
const { Http } = require("firebug.sdk/lib/core/http.js");

// DevTools
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const { makeInfallible } = devtools["require"]("devtools/toolkit/DevToolsUtils.js");
const { devtools, makeInfallible } = require("firebug.sdk/lib/core/devtools.js");

// Platform Services
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
Expand Down
3 changes: 1 addition & 2 deletions lib/pixel-perfect-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const { setTimeout, clearTimeout } = require("sdk/timers");
const base64 = require("sdk/base64");

// DevTools
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const { makeInfallible } = devtools["require"]("devtools/toolkit/DevToolsUtils.js");
const { devtools, makeInfallible } = require("firebug.sdk/lib/core/devtools.js");

// File Services
const { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
Expand Down
3 changes: 1 addition & 2 deletions lib/start-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ const { AREA_PANEL, AREA_NAVBAR } = CustomizableUI;
const { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm", {});

// DevTools
const { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const { devtools, gDevTools } = require("firebug.sdk/lib/core/devtools.js");

const startButtonId = "pixel-perfect-start-button";

Expand Down
3 changes: 1 addition & 2 deletions lib/style-editor-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const { ToolbarButton } = require("firebug.sdk/lib/toolbar-button.js");
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

// DevTools
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const { makeInfallible } = devtools["require"]("devtools/toolkit/DevToolsUtils.js");
const { devtools, makeInfallible } = require("firebug.sdk/lib/core/devtools.js");

/**
* @overlay This object represents an overlay for the existing Style Editor
Expand Down

0 comments on commit 8ccebfe

Please sign in to comment.