Skip to content

Commit d89d73e

Browse files
committed
Fix compatibility with Firefox Nightly
1 parent b8f94c1 commit d89d73e

File tree

5 files changed

+35
-44
lines changed

5 files changed

+35
-44
lines changed

chrome/skin/classic/shared/firequery.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
/******************************************************************************/
1818
/* Toolbox Tooltip */
1919

20-
/* Use !important to overload rules with theme prefixes */
20+
/* Use !important to overload rules with theme prefixes. Note that size
21+
of the tooltip is dynamically computed in data-tooltip.js */
2122
.theme-tooltip-panel .panel-arrowcontent {
2223
padding: 0 !important;
2324
}

lib/data-tooltip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ DataTooltip.prototype =
122122
"-theme.css", "author");
123123

124124
// Theme paths have changed in Fx44. Also, it should be enough
125-
// to included only them variables.
125+
// to included only theme variables.
126126
loadSheet(win, "resource://devtools/client/themes/variables.css", "author");
127127

128128
// The tooltip is opened for clicked jQuery data, so pass

lib/firequery-actor.js

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,41 @@
1212
const { Cu, Ci, components } = require("chrome");
1313
const Events = require("sdk/event/core");
1414

15-
// DevTools
16-
// See also: https://bugzilla.mozilla.org/show_bug.cgi?id=912121
17-
var devtools;
18-
try {
19-
devtools = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {}).devtools;
20-
} catch (err) {
21-
devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
15+
function safeImport(...args) {
16+
for (var i=0; i<args.length; i++) {
17+
try {
18+
return Cu["import"](args[i], {});
19+
}
20+
catch (err) {
21+
}
22+
}
23+
return {};
2224
}
2325

24-
var DevToolsUtils;
25-
try {
26-
DevToolsUtils = devtools["require"]("devtools/shared/DevToolsUtils");
27-
} catch (err) {
28-
DevToolsUtils = devtools["require"]("devtools/toolkit/DevToolsUtils");
26+
function safeRequire(devtools, ...args) {
27+
for (var i=0; i<args.length; i++) {
28+
try {
29+
return devtools["require"](args[i]);
30+
}
31+
catch (err) {
32+
}
33+
}
34+
return {};
2935
}
3036

37+
// DevTools
38+
// See also: https://bugzilla.mozilla.org/show_bug.cgi?id=912121
39+
const devtools = safeImport(
40+
"resource://devtools/shared/Loader.jsm",
41+
"resource://gre/modules/devtools/shared/Loader.jsm",
42+
"resource://gre/modules/devtools/Loader.jsm"
43+
).devtools;
44+
45+
const DevToolsUtils = safeRequire(devtools,
46+
"devtools/shared/DevToolsUtils",
47+
"devtools/toolkit/DevToolsUtils"
48+
);
49+
3150
const { NodeActor } = devtools["require"]("devtools/server/actors/inspector");
3251
const makeInfallible = DevToolsUtils.makeInfallible;
3352

lib/inspector-overlay.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ const { defer } = require("sdk/core/promise");
1717
// Firebug SDK
1818
const { devtools, safeRequire } = require("firebug.sdk/lib/core/devtools.js");
1919

20-
// See also: https://bugzilla.mozilla.org/show_bug.cgi?id=912121
21-
var { MarkupView } = safeRequire(devtools,
22-
"devtools/client/markupview/markup-view",
23-
"devtools/markupview/markup-view");
24-
2520
const { Trace, TraceError } = require("firebug.sdk/lib/core/trace.js").get(module.id);
2621
const { PanelOverlay } = require("firebug.sdk/lib/panel-overlay.js");
2722
const { Dom } = require("firebug.sdk/lib/core/dom.js");
@@ -358,29 +353,5 @@ const InspectorOverlay = Class(
358353
}
359354
});
360355

361-
// Patching MarkupView (fire a new "container-created" event)
362-
// Bug 1036949 - New API: MarkupView customization
363-
// xxxHonza: Can be removed as soon as Fx42 is the
364-
// minimum required version.
365-
let originalImportNode = MarkupView.prototype.importNode;
366-
MarkupView.prototype.importNode = function(aNode, aFlashNode) {
367-
if (!aNode) {
368-
return null;
369-
}
370-
371-
if (this._containers.has(aNode)) {
372-
return this.getContainer(aNode);
373-
}
374-
375-
let container = originalImportNode.apply(this, arguments);
376-
377-
// Feature detection based on nodeFront.getFormProperty() API
378-
let nodeFront = container.node;
379-
if (!nodeFront.getFormProperty) {
380-
this._inspector.emit("container-created", container);
381-
}
382-
383-
return container;
384-
}
385356
// Exports from this module
386357
exports.InspectorOverlay = InspectorOverlay;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"homepage": "https://github.com/firebug/firequery/wiki",
1616
"forum": "https://groups.google.com/forum/#!forum/firebug",
1717
"engines": {
18-
"firefox": ">=40.0a1"
18+
"firefox": ">=42.0a1"
1919
},
2020
"license": "BSD-3-Clause",
2121
"repository": {

0 commit comments

Comments
 (0)