зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1193390 - Remove single arg Cu.import from /devtools. r=tromey
A few miscellaneous linting issues also addressed near the lines involved. MozReview-Commit-ID: 9t1RwxdSS2X
This commit is contained in:
Родитель
66ea2b9a74
Коммит
ca7fb511f8
|
@ -107,6 +107,7 @@ devtools/client/webconsole/**
|
|||
!devtools/client/webconsole/jsterm.js
|
||||
!devtools/client/webconsole/console-commands.js
|
||||
devtools/client/webide/**
|
||||
!devtools/client/webide/components/webideCli.js
|
||||
devtools/server/**
|
||||
!devtools/server/actors/webbrowser.js
|
||||
!devtools/server/actors/styles.js
|
||||
|
@ -117,6 +118,7 @@ devtools/shared/*.js
|
|||
!devtools/shared/event-emitter.js
|
||||
!devtools/shared/task.js
|
||||
devtools/shared/*.jsm
|
||||
!devtools/shared/Loader.jsm
|
||||
devtools/shared/apps/**
|
||||
devtools/shared/client/**
|
||||
devtools/shared/discovery/**
|
||||
|
|
|
@ -29,8 +29,9 @@
|
|||
"mozilla/mark-test-function-used": 1,
|
||||
"mozilla/no-aArgs": 1,
|
||||
"mozilla/no-cpows-in-tests": 2,
|
||||
"mozilla/no-single-arg-cu-import": 2,
|
||||
// See bug 1224289.
|
||||
"mozilla/reject-importGlobalProperties": 1,
|
||||
"mozilla/reject-importGlobalProperties": 2,
|
||||
"mozilla/var-only-at-top-level": 1,
|
||||
|
||||
// Rules from the React plugin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
var { loader, require } = Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
var { loader, require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var { Task } = require("devtools/shared/task");
|
||||
|
||||
loader.lazyRequireGetter(this, "promise");
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cu} = require("chrome");
|
||||
var {loader} = Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
|
||||
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
|
|
@ -5,10 +5,9 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { SideMenuWidget } = require("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
const promise = require("promise");
|
||||
const Services = require("Services");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/* import-globals-from ../../debugger-controller.js */
|
||||
|
||||
const actions = require("../actions/event-listeners");
|
||||
const { bindActionCreators } = require("devtools/client/shared/vendor/redux");
|
||||
const { Heritage, WidgetMethods } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { SideMenuWidget } = require("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
|
||||
/**
|
||||
* Functions handling the event listeners UI.
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/* 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/. */
|
||||
/* import-globals-from ../../debugger-controller.js */
|
||||
|
||||
"use strict";
|
||||
|
||||
/* import-globals-from ../../debugger-controller.js */
|
||||
|
||||
const utils = require("../utils");
|
||||
const {
|
||||
getSelectedSource,
|
||||
|
@ -24,6 +26,7 @@ const {
|
|||
setNamedTimeout
|
||||
} = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const { SideMenuWidget } = require("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
|
||||
const NEW_SOURCE_DISPLAY_DELAY = 200; // ms
|
||||
const FUNCTION_SEARCH_POPUP_POSITION = "topcenter bottomleft";
|
||||
|
|
|
@ -96,20 +96,19 @@ const FRAME_TYPE = {
|
|||
PUBLIC_CLIENT_EVAL: 3
|
||||
};
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
Cu.import("resource://devtools/client/shared/widgets/SimpleListWidget.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/BreadcrumbsWidget.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/VariablesViewController.jsm");
|
||||
|
||||
Cu.import("resource://devtools/client/shared/browser-loader.js");
|
||||
const { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
const { require } = BrowserLoader({
|
||||
baseURI: "resource://devtools/client/debugger/",
|
||||
window,
|
||||
});
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineConstant(this, "require", require);
|
||||
const { SimpleListWidget } = require("resource://devtools/client/shared/widgets/SimpleListWidget.jsm");
|
||||
const { BreadcrumbsWidget } = require("resource://devtools/client/shared/widgets/BreadcrumbsWidget.jsm");
|
||||
const { SideMenuWidget } = require("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
const { VariablesView } = require("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
const { VariablesViewController, StackFrameUtils } = require("resource://devtools/client/shared/widgets/VariablesViewController.jsm");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
const { ViewHelpers, Heritage, WidgetMethods, setNamedTimeout,
|
||||
clearNamedTimeout } = require("devtools/client/shared/widgets/view-helpers");
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
|
|
@ -28,10 +28,8 @@
|
|||
<script type="text/javascript" src="debugger-view.js"/>
|
||||
<script type="text/javascript" src="utils.js"/>
|
||||
<script type="text/javascript" src="views/workers-view.js"/>
|
||||
<script type="text/javascript" src="views/sources-view.js"/>
|
||||
<script type="text/javascript" src="views/variable-bubble-view.js"/>
|
||||
<script type="text/javascript" src="views/watch-expressions-view.js"/>
|
||||
<script type="text/javascript" src="views/event-listeners-view.js"/>
|
||||
<script type="text/javascript" src="views/global-search-view.js"/>
|
||||
<script type="text/javascript" src="views/toolbar-view.js"/>
|
||||
<script type="text/javascript" src="views/options-view.js"/>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
var { interfaces: Ci, classes: Cc, utils: Cu } = Components;
|
||||
"use strict";
|
||||
|
||||
var { interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
function notify() {
|
||||
// Log objects so makeDebuggeeValue can get the global to use
|
||||
|
@ -9,13 +11,13 @@ function notify() {
|
|||
}
|
||||
|
||||
function startup(aParams, aReason) {
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
let res = Services.io.getProtocolHandler("resource")
|
||||
.QueryInterface(Ci.nsIResProtocolHandler);
|
||||
res.setSubstitution("browser_dbg_addon4", aParams.resourceURI);
|
||||
|
||||
// Load a JS module
|
||||
Cu.import("resource://browser_dbg_addon4/test.jsm");
|
||||
Cu.import("resource://browser_dbg_addon4/test.jsm"); // eslint-disable-line mozilla/no-single-arg-cu-import
|
||||
// Log objects so makeDebuggeeValue can get the global to use
|
||||
console.log({ msg: "Hello from the test add-on" });
|
||||
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
* 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/. */
|
||||
|
||||
/* FIXME: remove this globals comment and replace with import-globals-from when
|
||||
bug 1242893 is fixed */
|
||||
/* globals BrowserToolboxProcess */
|
||||
|
||||
/**
|
||||
* This XPCOM component is loaded very early.
|
||||
* It handles command line arguments like -jsconsole, but also ensures starting
|
||||
|
@ -22,7 +18,7 @@ const kDebuggerPrefs = [
|
|||
"devtools.debugger.remote-enabled",
|
||||
"devtools.chrome.enabled"
|
||||
];
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
|
||||
function DevToolsStartup() {}
|
||||
|
@ -126,7 +122,7 @@ DevToolsStartup.prototype = {
|
|||
if (!this._isRemoteDebuggingEnabled()) {
|
||||
return;
|
||||
}
|
||||
Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm");
|
||||
const { BrowserToolboxProcess } = Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", {});
|
||||
BrowserToolboxProcess.init();
|
||||
|
||||
if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO) {
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
* 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");
|
||||
"use strict";
|
||||
|
||||
const {Cc, Ci} = require("chrome");
|
||||
const {rgbToHsl, rgbToColorName} =
|
||||
require("devtools/client/shared/css-color").colorUtils;
|
||||
const Telemetry = require("devtools/client/shared/telemetry");
|
||||
const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const promise = require("promise");
|
||||
const Services = require("Services");
|
||||
|
||||
|
@ -182,7 +184,8 @@ Eyedropper.prototype = {
|
|||
* Get color of center cell in the grid.
|
||||
*/
|
||||
get centerColor() {
|
||||
let x = y = (this.centerCell * this.cellSize) + (this.cellSize / 2);
|
||||
let x, y;
|
||||
x = y = (this.centerCell * this.cellSize) + (this.cellSize / 2);
|
||||
let rgb = this._ctx.getImageData(x, y, 1, 1).data;
|
||||
return rgb;
|
||||
},
|
||||
|
@ -727,7 +730,8 @@ Eyedropper.prototype = {
|
|||
* Draw a box on the canvas to highlight the center cell.
|
||||
*/
|
||||
_drawCrosshair: function () {
|
||||
let x = y = this.centerCell * this.cellSize;
|
||||
let x, y;
|
||||
x = y = this.centerCell * this.cellSize;
|
||||
|
||||
this._ctx.lineWidth = 1;
|
||||
this._ctx.lineJoin = "miter";
|
||||
|
|
|
@ -11,8 +11,8 @@ const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
|||
const DBG_XUL = "chrome://devtools/content/framework/toolbox-process-window.xul";
|
||||
const CHROME_DEBUGGER_PROFILE_NAME = "chrome_debugger_profile";
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { require, DevToolsLoader } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "Telemetry", function () {
|
||||
return require("devtools/client/shared/telemetry");
|
||||
|
|
|
@ -7,13 +7,12 @@
|
|||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var Services = require("Services");
|
||||
var {gDevTools} = require("devtools/client/framework/devtools");
|
||||
var {TargetFactory} = require("devtools/client/framework/target");
|
||||
var {Toolbox} = require("devtools/client/framework/toolbox");
|
||||
var promise = require("promise");
|
||||
var {DebuggerClient} = require("devtools/shared/client/main");
|
||||
var {Task} = require("devtools/shared/task");
|
||||
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* 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 {Cu} = require("chrome");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
"use strict";
|
||||
|
||||
var {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var Services = require("Services");
|
||||
var {Task} = require("devtools/shared/task");
|
||||
var EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { Ci, Cu } = require("chrome");
|
||||
const { Ci } = require("chrome");
|
||||
const promise = require("promise");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const Services = require("Services");
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
loader.lazyRequireGetter(this, "DebuggerClient",
|
||||
"devtools/shared/client/main", true);
|
||||
|
|
|
@ -6,11 +6,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cu} = require("chrome");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const promise = require("promise");
|
||||
const Services = require("Services");
|
||||
Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
const {DOMHelpers} = require("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
|
||||
loader.lazyRequireGetter(this, "system", "devtools/shared/system");
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
@ -26,9 +24,7 @@ var viewSource = require("devtools/client/shared/view-source");
|
|||
var { attachThread, detachThread } = require("./attach-thread");
|
||||
var Menu = require("devtools/client/framework/menu");
|
||||
var MenuItem = require("devtools/client/framework/menu-item");
|
||||
|
||||
Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
|
||||
Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
var { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
|
||||
const { BrowserLoader } =
|
||||
Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cc, Ci, Cu} = require("chrome");
|
||||
const {Cc, Ci} = require("chrome");
|
||||
|
||||
const ToolDefinitions = require("devtools/client/definitions").Tools;
|
||||
const {CssLogic} = require("devtools/shared/inspector/css-logic");
|
||||
|
@ -19,6 +19,7 @@ const {OutputParser} = require("devtools/client/shared/output-parser");
|
|||
const {PrefObserver, PREF_ORIG_SOURCES} = require("devtools/client/styleeditor/utils");
|
||||
const {createChild} = require("devtools/client/inspector/shared/utils");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
loader.lazyRequireGetter(this, "overlays",
|
||||
"devtools/client/inspector/shared/style-inspector-overlays");
|
||||
|
@ -27,8 +28,6 @@ loader.lazyRequireGetter(this, "StyleInspectorMenu",
|
|||
loader.lazyRequireGetter(this, "KeyShortcuts",
|
||||
"devtools/client/shared/key-shortcuts", true);
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
|
||||
"resource://gre/modules/PluralForm.jsm");
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cc, Cu, Ci} = require("chrome");
|
||||
const {Cc, Ci} = require("chrome");
|
||||
|
||||
// Page size for pageup/pagedown
|
||||
const PAGE_SIZE = 10;
|
||||
|
@ -49,8 +49,7 @@ const {PrefObserver} = require("devtools/client/styleeditor/utils");
|
|||
const {KeyShortcuts} = require("devtools/client/shared/key-shortcuts");
|
||||
const {template} = require("devtools/shared/gcli/templater");
|
||||
const nodeConstants = require("devtools/shared/dom-node-constants");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
loader.lazyRequireGetter(this, "CSS", "CSS");
|
||||
loader.lazyGetter(this, "DOMParser", () => {
|
||||
|
|
|
@ -6,13 +6,12 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cc, Ci, Cu} = require("chrome");
|
||||
const {Cc, Ci} = require("chrome");
|
||||
const promise = require("promise");
|
||||
const {Rule} = require("devtools/client/inspector/rules/models/rule");
|
||||
const {promiseWarn} = require("devtools/client/inspector/shared/utils");
|
||||
const {ELEMENT_STYLE} = require("devtools/server/actors/styles");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
loader.lazyGetter(this, "PSEUDO_ELEMENTS", () => {
|
||||
return domUtils.getCSSPseudoElementNames();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cc, Ci, Cu} = require("chrome");
|
||||
const {Cc, Ci} = require("chrome");
|
||||
const promise = require("promise");
|
||||
const {CssLogic} = require("devtools/shared/inspector/css-logic");
|
||||
const {ELEMENT_STYLE} = require("devtools/server/actors/styles");
|
||||
|
@ -15,8 +15,7 @@ const {TextProperty} =
|
|||
const {promiseWarn} = require("devtools/client/inspector/shared/utils");
|
||||
const {parseDeclarations} = require("devtools/shared/css-parsing-utils");
|
||||
const {getCssProperties} = require("devtools/shared/fronts/css-properties");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "osString", function () {
|
||||
return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
|
||||
|
|
|
@ -6,11 +6,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cc, Ci, Cu} = require("chrome");
|
||||
const {Cc, Ci} = require("chrome");
|
||||
const {escapeCSSComment} = require("devtools/shared/css-parsing-utils");
|
||||
const {getCssProperties} = require("devtools/shared/fronts/css-properties");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "domUtils", function () {
|
||||
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"use strict";
|
||||
|
||||
// Testing navigation between nodes in search results
|
||||
var {AppConstants} = Cu.import("resource://gre/modules/AppConstants.jsm");
|
||||
const {AppConstants} = require("resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
const TEST_URL = URL_ROOT + "doc_inspector_search.html";
|
||||
|
||||
|
|
|
@ -4,13 +4,12 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
Cu.import("resource://testing-common/Assert.jsm");
|
||||
|
||||
Cu.import("resource://devtools/client/shared/browser-loader.js");
|
||||
var { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
var { require } = BrowserLoader({
|
||||
baseURI: "resource://devtools/client/memory/",
|
||||
window: this
|
||||
});
|
||||
var { Assert } = require("resource://testing-common/Assert.jsm");
|
||||
var Services = require("Services");
|
||||
var { Task } = require("devtools/shared/task");
|
||||
|
||||
|
|
|
@ -108,10 +108,6 @@ const ACTIVITY_TYPE = {
|
|||
DISABLE_CACHE: 4
|
||||
};
|
||||
|
||||
Cu.import("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/VariablesViewController.jsm");
|
||||
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const promise = require("promise");
|
||||
const Services = require("Services");
|
||||
|
@ -119,7 +115,7 @@ const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
|||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const Editor = require("devtools/client/sourceeditor/editor");
|
||||
const {TimelineFront} = require("devtools/shared/fronts/timeline");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const {Task} = require("devtools/shared/task");
|
||||
|
||||
XPCOMUtils.defineConstant(this, "EVENTS", EVENTS);
|
||||
XPCOMUtils.defineConstant(this, "ACTIVITY_TYPE", ACTIVITY_TYPE);
|
||||
|
|
|
@ -18,6 +18,9 @@ XPCOMUtils.defineLazyGetter(this, "NetworkHelper", function () {
|
|||
return require("devtools/shared/webconsole/network-helper");
|
||||
});
|
||||
|
||||
const {SideMenuWidget} = require("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
const {VariablesView} = require("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
const {VariablesViewController} = require("resource://devtools/client/shared/widgets/VariablesViewController.jsm");
|
||||
const {ToolSidebar} = require("devtools/client/framework/sidebar");
|
||||
const {Tooltip} = require("devtools/client/shared/widgets/Tooltip");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
Cu.import("resource://testing-common/Assert.jsm");
|
||||
var { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
var { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
|
||||
var { Assert } = require("resource://testing-common/Assert.jsm");
|
||||
var promise = require("promise");
|
||||
var { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
var { Task } = require("devtools/shared/task");
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { Cc, Ci, Cu } = require("chrome");
|
||||
const { Class } = require("sdk/core/heritage");
|
||||
const { Project } = require("devtools/client/projecteditor/lib/project");
|
||||
|
@ -17,7 +17,7 @@ const { emit } = require("sdk/event/core");
|
|||
const { merge } = require("sdk/util/object");
|
||||
const promise = require("promise");
|
||||
const { ViewHelpers } = require("devtools/client/shared/widgets/view-helpers");
|
||||
const { DOMHelpers } = Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
const { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
const Services = require("Services");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const ITCHPAD_URL = "chrome://devtools/content/projecteditor/chrome/content/projecteditor.xul";
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
const { Cc, Ci, Cu, ChromeWorker } = require("chrome");
|
||||
const { Class } = require("sdk/core/heritage");
|
||||
const { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
|
||||
const { OS } = require("resource://gre/modules/osfile.jsm");
|
||||
const { emit } = require("sdk/event/core");
|
||||
const { Store } = require("devtools/client/projecteditor/lib/stores/base");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
|
@ -213,4 +213,3 @@ var LocalStore = Class({
|
|||
}
|
||||
});
|
||||
exports.LocalStore = LocalStore;
|
||||
|
||||
|
|
|
@ -55,12 +55,12 @@ const Services = require("Services");
|
|||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const {Heritage} = require("devtools/client/shared/widgets/view-helpers");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
|
||||
Cu.import("resource://gre/modules/jsdebugger.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
Cu.import("resource://gre/modules/reflect.jsm");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {NetUtil} = require("resource://gre/modules/NetUtil.jsm");
|
||||
const {ScratchpadManager} = require("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
|
||||
const {addDebuggerToGlobal} = require("resource://gre/modules/jsdebugger.jsm");
|
||||
const {OS} = require("resource://gre/modules/osfile.jsm");
|
||||
const {Reflect} = require("resource://gre/modules/reflect.jsm");
|
||||
|
||||
XPCOMUtils.defineConstant(this, "SCRATCHPAD_CONTEXT_CONTENT", SCRATCHPAD_CONTEXT_CONTENT);
|
||||
XPCOMUtils.defineConstant(this, "SCRATCHPAD_CONTEXT_BROWSER", SCRATCHPAD_CONTEXT_BROWSER);
|
||||
|
|
|
@ -5,10 +5,9 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {SideMenuWidget} = require("resource://devtools/client/shared/widgets/SideMenuWidget.jsm");
|
||||
const promise = require("promise");
|
||||
const Services = require("Services");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["DOMHelpers"];
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ const { devtools } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
|||
const { joinURI } = devtools.require("devtools/shared/path");
|
||||
const { assert } = devtools.require("devtools/shared/DevToolsUtils");
|
||||
const Services = devtools.require("Services");
|
||||
Cu.import("resource://gre/modules/AppConstants.jsm");
|
||||
const { AppConstants } = devtools.require("resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
const BROWSER_BASED_DIRS = [
|
||||
"resource://devtools/client/jsonview",
|
||||
|
|
|
@ -4,9 +4,8 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
Cu.import("resource://testing-common/Assert.jsm");
|
||||
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var { Assert } = require("resource://testing-common/Assert.jsm");
|
||||
var { gDevTools } = require("devtools/client/framework/devtools");
|
||||
var { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
var promise = require("promise");
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Ci, Cu, Cc} = require("chrome");
|
||||
const {Ci, Cc} = require("chrome");
|
||||
const Services = require("Services");
|
||||
|
||||
const HTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
|
@ -42,7 +42,7 @@ const MAX_POPUP_ENTRIES = 500;
|
|||
const FOCUS_FORWARD = Ci.nsIFocusManager.MOVEFOCUS_FORWARD;
|
||||
const FOCUS_BACKWARD = Ci.nsIFocusManager.MOVEFOCUS_BACKWARD;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const { findMostRelevantCssPropertyIndex } = require("./suggestion-picker");
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
const {angleUtils} = require("devtools/client/shared/css-angle");
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ var Cu = Components.utils;
|
|||
var Ci = Components.interfaces;
|
||||
var Cc = Components.classes;
|
||||
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
var {require, loader} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {colorUtils} = require("devtools/client/shared/css-color");
|
||||
|
||||
loader.lazyGetter(this, "DOMUtils", function () {
|
||||
|
|
|
@ -9,7 +9,7 @@ var Cu = Components.utils;
|
|||
var Ci = Components.interfaces;
|
||||
var Cc = Components.classes;
|
||||
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
const DOMUtils = Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
const {escapeCSSComment, _unescapeCSSComment} = devtools.require("devtools/shared/css-parsing-utils");
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {escapeCSSComment, _unescapeCSSComment} = require("devtools/shared/css-parsing-utils");
|
||||
|
||||
const TEST_DATA = [
|
||||
{
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
const {RuleRewriter} = devtools.require("devtools/shared/css-parsing-utils");
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {RuleRewriter} = require("devtools/shared/css-parsing-utils");
|
||||
const {isCssPropertyKnown} = require("devtools/server/actors/css-properties");
|
||||
|
||||
const TEST_DATA = [
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
const { interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { ViewHelpers } = require("devtools/client/shared/widgets/view-helpers");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
|
||||
|
|
|
@ -5,14 +5,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
const ENSURE_SELECTION_VISIBLE_DELAY = 50; // ms
|
||||
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { ViewHelpers, setNamedTimeout } = require("devtools/client/shared/widgets/view-helpers");
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["BreadcrumbsWidget"];
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
const NET_STRINGS_URI = "chrome://devtools/locale/netmonitor.properties";
|
||||
|
@ -17,11 +16,9 @@ const NAMED_SLICE_MIN_ANGLE = TAU / 8;
|
|||
const NAMED_SLICE_TEXT_DISTANCE_RATIO = 1.9;
|
||||
const HOVERED_SLICE_TRANSLATE_DISTANCE_RATIO = 20;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["Chart"];
|
||||
|
|
|
@ -10,9 +10,8 @@ const Cu = Components.utils;
|
|||
|
||||
const SHARED_STRINGS_URI = "chrome://devtools/locale/shared.properties";
|
||||
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const { LocalizationHelper } = require("devtools/client/shared/l10n");
|
||||
const { ViewHelpers } = require("devtools/client/shared/widgets/view-helpers");
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Cu, Ci} = require("chrome");
|
||||
const {Ci} = require("chrome");
|
||||
const promise = require("promise");
|
||||
const {Spectrum} = require("devtools/client/shared/widgets/Spectrum");
|
||||
const {CubicBezierWidget} =
|
||||
|
@ -17,14 +17,13 @@ const {colorUtils} = require("devtools/client/shared/css-color");
|
|||
const Heritage = require("sdk/core/heritage");
|
||||
const {Eyedropper} = require("devtools/client/eyedropper/eyedropper");
|
||||
const Services = require("Services");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
loader.lazyRequireGetter(this, "beautify", "devtools/shared/jsbeautify/beautify");
|
||||
loader.lazyRequireGetter(this, "setNamedTimeout", "devtools/client/shared/widgets/view-helpers", true);
|
||||
loader.lazyRequireGetter(this, "clearNamedTimeout", "devtools/client/shared/widgets/view-helpers", true);
|
||||
loader.lazyRequireGetter(this, "setNamedTimeout", "devtools/client/shared/widgets/view-helpers", true);
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "VariablesView",
|
||||
"resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "VariablesViewController",
|
||||
|
|
|
@ -10,16 +10,15 @@ const Cu = Components.utils;
|
|||
|
||||
const DBG_STRINGS_URI = "chrome://devtools/locale/debugger.properties";
|
||||
const LAZY_EMPTY_DELAY = 150; // ms
|
||||
const LAZY_EXPAND_DELAY = 50; // ms
|
||||
const SCROLL_PAGE_SIZE_DEFAULT = 0;
|
||||
const PAGE_SIZE_SCROLL_HEIGHT_RATIO = 100;
|
||||
const PAGE_SIZE_MAX_JUMPS = 30;
|
||||
const SEARCH_ACTION_MAX_DELAY = 300; // ms
|
||||
const ITEM_FLASH_DURATION = 300; // ms
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const Services = require("Services");
|
||||
const { getSourceNames } = require("devtools/client/shared/source-utils");
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
const { utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var {VariablesView} = require("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
var Services = require("Services");
|
||||
var promise = require("promise");
|
||||
var {LocalizationHelper} = require("devtools/client/shared/l10n");
|
||||
|
|
|
@ -4,9 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { NetUtil } = require("resource://gre/modules/NetUtil.jsm");
|
||||
const Editor = require("devtools/client/sourceeditor/editor");
|
||||
const promise = require("promise");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
|
|
@ -12,15 +12,19 @@ const Cu = Components.utils;
|
|||
|
||||
const {require, loader} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const Services = require("Services");
|
||||
const {NetUtil} = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
const {OS} = Cu.import("resource://gre/modules/osfile.jsm", {});
|
||||
const {NetUtil} = require("resource://gre/modules/NetUtil.jsm");
|
||||
const {OS} = require("resource://gre/modules/osfile.jsm");
|
||||
const {Task} = require("devtools/shared/task");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
/* import-globals-from StyleEditorUtil.jsm */
|
||||
Cu.import("resource://devtools/client/styleeditor/StyleEditorUtil.jsm");
|
||||
const {SplitView} = Cu.import("resource://devtools/client/shared/SplitView.jsm", {});
|
||||
const {StyleSheetEditor} = Cu.import("resource://devtools/client/styleeditor/StyleSheetEditor.jsm");
|
||||
const {
|
||||
getString,
|
||||
text,
|
||||
wire,
|
||||
showFilePicker,
|
||||
} = require("resource://devtools/client/styleeditor/StyleEditorUtil.jsm");
|
||||
const {SplitView} = require("resource://devtools/client/shared/SplitView.jsm");
|
||||
const {StyleSheetEditor} = require("resource://devtools/client/styleeditor/StyleSheetEditor.jsm");
|
||||
loader.lazyImporter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
|
||||
const {PrefObserver, PREF_ORIG_SOURCES} =
|
||||
require("devtools/client/styleeditor/utils");
|
||||
|
@ -28,7 +32,7 @@ const csscoverage = require("devtools/shared/fronts/csscoverage");
|
|||
const {console} = require("resource://gre/modules/Console.jsm");
|
||||
const promise = require("promise");
|
||||
const {ResponsiveUIManager} =
|
||||
Cu.import("resource://devtools/client/responsivedesign/responsivedesign.jsm", {});
|
||||
require("resource://devtools/client/responsivedesign/responsivedesign.jsm");
|
||||
|
||||
const LOAD_ERROR = "error-load";
|
||||
const STYLE_EDITOR_TEMPLATE = "stylesheet";
|
||||
|
@ -619,8 +623,8 @@ StyleEditorUI.prototype = {
|
|||
if (reportData.reports.length > 0) {
|
||||
// Only apply if this file isn't compressed. We detect a
|
||||
// compressed file if there are more rules than lines.
|
||||
let text = showEditor.sourceEditor.getText();
|
||||
let lineCount = text.split("\n").length;
|
||||
let editorText = showEditor.sourceEditor.getText();
|
||||
let lineCount = editorText.split("\n").length;
|
||||
let ruleCount = showEditor.styleSheet.ruleCount;
|
||||
if (lineCount >= ruleCount) {
|
||||
showEditor.addUnusedRegions(reportData.reports);
|
||||
|
|
|
@ -19,12 +19,13 @@ const {console} = require("resource://gre/modules/Console.jsm");
|
|||
const Services = require("Services");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {Task} = require("devtools/shared/task");
|
||||
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { TextDecoder, OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
|
||||
/* import-globals-from StyleEditorUtil.jsm */
|
||||
Cu.import("resource://devtools/client/styleeditor/StyleEditorUtil.jsm");
|
||||
const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
const {NetUtil} = require("resource://gre/modules/NetUtil.jsm");
|
||||
const {TextDecoder, OS} = Cu.import("resource://gre/modules/osfile.jsm", {});
|
||||
const {
|
||||
getString,
|
||||
showFilePicker,
|
||||
} = require("resource://devtools/client/styleeditor/StyleEditorUtil.jsm");
|
||||
|
||||
const LOAD_ERROR = "error-load";
|
||||
const SAVE_ERROR = "error-save";
|
||||
|
|
|
@ -1,22 +1,17 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {Cu} = require("chrome");
|
||||
|
||||
var Services = require("Services");
|
||||
var promise = require("promise");
|
||||
var {Task} = require("devtools/shared/task");
|
||||
var {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
||||
Cu.import("resource://devtools/client/styleeditor/StyleEditorUI.jsm");
|
||||
/* import-globals-from StyleEditorUtil.jsm */
|
||||
Cu.import("resource://devtools/client/styleeditor/StyleEditorUtil.jsm");
|
||||
var {StyleEditorUI} = require("resource://devtools/client/styleeditor/StyleEditorUI.jsm");
|
||||
var {getString} = require("resource://devtools/client/styleeditor/StyleEditorUtil.jsm");
|
||||
|
||||
loader.lazyGetter(this, "StyleSheetsFront",
|
||||
() => require("devtools/shared/fronts/stylesheets").StyleSheetsFront);
|
||||
|
|
|
@ -5,12 +5,9 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const { loader, require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
var { EventTarget } = require("sdk/event/target");
|
||||
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { EventTarget } = require("sdk/event/target");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const { Class } = require("sdk/core/heritage");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
Cu.import("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/VariablesViewController.jsm");
|
||||
const { VariablesView } = require("resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
|
||||
const GENERIC_VARIABLES_VIEW_SETTINGS = {
|
||||
searchEnabled: false,
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
var { utils: Cu } = Components;
|
||||
/* global BrowserLoader */
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/client/shared/browser-loader.js");
|
||||
var { utils: Cu } = Components;
|
||||
|
||||
// Initialize module loader and load all modules of the new inline
|
||||
// preview feature. The entire code-base doesn't need any extra
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
var { utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/client/shared/browser-loader.js");
|
||||
const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
|
||||
const { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
|
||||
// Initialize module loader and load all modules of the new inline
|
||||
// preview feature. The entire code-base doesn't need any extra
|
||||
|
|
|
@ -8,9 +8,8 @@
|
|||
|
||||
var { utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://testing-common/Assert.jsm");
|
||||
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var { Assert } = require("resource://testing-common/Assert.jsm");
|
||||
var { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
var { Task } = require("devtools/shared/task");
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -17,8 +19,6 @@ function webideCli() { }
|
|||
|
||||
webideCli.prototype = {
|
||||
handle: function (cmdLine) {
|
||||
let param;
|
||||
|
||||
if (!cmdLine.handleFlag("webide", false)) {
|
||||
return;
|
||||
}
|
||||
|
@ -49,8 +49,7 @@ webideCli.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
helpInfo : "",
|
||||
helpInfo: "",
|
||||
|
||||
classID: Components.ID("{79b7b44e-de5e-4e4c-b7a2-044003c615d9}"),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
|
||||
|
|
|
@ -2,22 +2,23 @@
|
|||
* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Cu = Components.utils;
|
||||
var Ci = Components.interfaces;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ZipUtils", "resource://gre/modules/ZipUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Downloads", "resource://gre/modules/Downloads.jsm");
|
||||
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const Services = require("Services");
|
||||
const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
const {AppProjects} = require("devtools/client/webide/modules/app-projects");
|
||||
const {AppManager} = require("devtools/client/webide/modules/app-manager");
|
||||
const {getJSON} = require("devtools/client/shared/getjson");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ZipUtils", "resource://gre/modules/ZipUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Downloads", "resource://gre/modules/Downloads.jsm");
|
||||
|
||||
const TEMPLATES_URL = "devtools.webide.templatesURL";
|
||||
|
||||
var gTemplateList = null;
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
* 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/. */
|
||||
|
||||
var Cu = Components.utils;
|
||||
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
|
||||
"use strict";
|
||||
|
||||
const Cu = Components.utils;
|
||||
const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
|
||||
window.addEventListener("load", function onLoad() {
|
||||
window.removeEventListener("load", onLoad);
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
* 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 {Cu} = require("chrome");
|
||||
"use strict";
|
||||
|
||||
const promise = require("promise");
|
||||
const {AddonManager} = Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
const {AddonManager} = require("resource://gre/modules/AddonManager.jsm");
|
||||
const Services = require("Services");
|
||||
const {getJSON} = require("devtools/client/shared/getjson");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
* 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 {Cu} = require("chrome");
|
||||
"use strict";
|
||||
|
||||
const Services = require("Services");
|
||||
const {AppManager} = require("devtools/client/webide/modules/app-manager");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {RuntimeScanners, WiFiScanner} = require("devtools/client/webide/modules/runtimes");
|
||||
const {Devices} = Cu.import("resource://devtools/shared/apps/Devices.jsm");
|
||||
const {Devices} = require("resource://devtools/shared/apps/Devices.jsm");
|
||||
const {Task} = require("devtools/shared/task");
|
||||
const utils = require("devtools/client/webide/modules/utils");
|
||||
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
* 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 {Cu, Ci} = require("chrome");
|
||||
"use strict";
|
||||
|
||||
const {Ci} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const {Devices} = Cu.import("resource://devtools/shared/apps/Devices.jsm");
|
||||
const {Devices} = require("resource://devtools/shared/apps/Devices.jsm");
|
||||
const {Connection} = require("devtools/shared/client/connection-manager");
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const {Simulators} = require("devtools/client/webide/modules/simulators");
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
* 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 { Cu } = require("chrome");
|
||||
const { AddonManager } = Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
"use strict";
|
||||
|
||||
const { AddonManager } = require("resource://gre/modules/AddonManager.jsm");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
loader.lazyRequireGetter(this, "ConnectionManager", "devtools/shared/client/connection-manager", true);
|
||||
loader.lazyRequireGetter(this, "AddonSimulatorProcess", "devtools/client/webide/modules/simulator-process", true);
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
|
||||
var {utils: Cu, classes: Cc, interfaces: Ci} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const promise = require("promise");
|
||||
const Services = require("Services");
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
* 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 {Ci, Cu} = require("chrome");
|
||||
"use strict";
|
||||
|
||||
const {Ci} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const promise = require("promise");
|
||||
|
@ -10,9 +12,8 @@ const {LongStringActor} = require("devtools/server/actors/string");
|
|||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const {getSystemInfo, getSetting} = require("devtools/shared/system");
|
||||
const {deviceSpec} = require("devtools/shared/specs/device");
|
||||
|
||||
Cu.importGlobalProperties(["FileReader"]);
|
||||
Cu.import("resource://gre/modules/PermissionsTable.jsm");
|
||||
const FileReader = require("FileReader");
|
||||
const {PermissionsTable} = require("resource://gre/modules/PermissionsTable.jsm");
|
||||
|
||||
var DeviceActor = exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, {
|
||||
_desc: null,
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* The eventLoopLag actor emits "event-loop-lag" events when the event
|
||||
* loop gets unresponsive. The event comes with a "time" property (the
|
||||
* duration of the lag in milliseconds).
|
||||
*/
|
||||
|
||||
const {Ci, Cu} = require("chrome");
|
||||
const {Ci} = require("chrome");
|
||||
const Services = require("Services");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const {method, Arg, RetVal} = protocol;
|
||||
const events = require("sdk/event/core");
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
const { Ci } = require("chrome");
|
||||
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const events = require("sdk/event/core");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const { Arg, Option, method, RetVal } = protocol;
|
||||
const { isWindowIncluded } = require("devtools/shared/layout/utils");
|
||||
const { highlighterSpec, customHighlighterSpec } = require("devtools/shared/specs/highlighters");
|
||||
const { isXUL, isNodeValid } = require("./highlighters/utils/markup");
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
* These dedicated classes are used by the LayoutChangesObserver.
|
||||
*/
|
||||
|
||||
const {Ci, Cu} = require("chrome");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {Ci} = require("chrome");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const {method, Arg} = protocol;
|
||||
const events = require("sdk/event/core");
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* 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 {Ci, Cu, Cc} = require("chrome");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
"use strict";
|
||||
|
||||
const {Ci, Cc} = require("chrome");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const Services = require("Services");
|
||||
|
||||
function MonitorActor(aConnection) {
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
* 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, CC} = require("chrome");
|
||||
"use strict";
|
||||
|
||||
const {Cc, Ci} = require("chrome");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const {Arg, method, RetVal} = protocol;
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const promise = require("promise");
|
||||
const Services = require("Services");
|
||||
const { settingsSpec } = require("devtools/shared/specs/settings");
|
||||
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
const { NetUtil} = require("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
var defaultSettings = {};
|
||||
var settingsFile;
|
||||
|
|
|
@ -4,18 +4,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var { components, Cc, Ci, Cu } = require("chrome");
|
||||
var Services = require("Services");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
const {Cc, Ci} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const promise = require("promise");
|
||||
const events = require("sdk/event/core");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const {Arg, Option, method, RetVal, types} = protocol;
|
||||
const {LongStringActor} = require("devtools/server/actors/string");
|
||||
const {Arg, method, RetVal} = protocol;
|
||||
const {fetch} = require("devtools/shared/DevToolsUtils");
|
||||
const {oldStyleSheetSpec, styleEditorSpec} = require("devtools/shared/specs/styleeditor");
|
||||
|
||||
|
|
|
@ -4,18 +4,13 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var { components, Cc, Ci, Cu } = require("chrome");
|
||||
var Services = require("Services");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
const {Cc, Ci} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const promise = require("promise");
|
||||
const {Task} = require("devtools/shared/task");
|
||||
const events = require("sdk/event/core");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const {Arg, Option, method, RetVal, types} = protocol;
|
||||
const {LongStringActor} = require("devtools/server/actors/string");
|
||||
const {fetch} = require("devtools/shared/DevToolsUtils");
|
||||
const {listenOnce} = require("devtools/shared/async-utils");
|
||||
|
|
|
@ -4,20 +4,26 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var {Cu, Cc, Ci} = require("chrome");
|
||||
var { Cu, Cc, Ci } = require("chrome");
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://gre/modules/UserCustomizations.jsm");
|
||||
Cu.importGlobalProperties(["FileReader"]);
|
||||
var { NetUtil } = require("resource://gre/modules/NetUtil.jsm");
|
||||
var { OS } = require("resource://gre/modules/osfile.jsm");
|
||||
var { FileUtils } = require("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
var promise = require("promise");
|
||||
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
var { ActorPool } = require("devtools/server/actors/common");
|
||||
var { DebuggerServer } = require("devtools/server/main");
|
||||
var Services = require("Services");
|
||||
var FileReader = require("FileReader");
|
||||
|
||||
// Load actor dependencies lazily as this actor require extra environnement
|
||||
// preparation to work (like have a profile setup in xpcshell tests)
|
||||
loader.lazyRequireGetter(this, "DOMApplicationRegistry", "resource://gre/modules/Webapps.jsm", true);
|
||||
loader.lazyRequireGetter(this, "AppsUtils", "resource://gre/modules/AppsUtils.jsm", true);
|
||||
loader.lazyRequireGetter(this, "ManifestHelper", "resource://gre/modules/AppsUtils.jsm", true);
|
||||
loader.lazyRequireGetter(this, "MessageBroadcaster", "resource://gre/modules/MessageBroadcaster.jsm", true);
|
||||
loader.lazyRequireGetter(this, "UserCustomizations", "resource://gre/modules/UserCustomizations.jsm", true);
|
||||
|
||||
// Comma separated list of permissions that a sideloaded app can't ask for
|
||||
const UNSAFE_PERMISSIONS = Services.prefs.getCharPref("devtools.apps.forbidden-permissions");
|
||||
|
@ -207,14 +213,6 @@ PackageUploadBulkActor.prototype.requestTypes = {
|
|||
*/
|
||||
function WebappsActor(aConnection) {
|
||||
debug("init");
|
||||
// Load actor dependencies lazily as this actor require extra environnement
|
||||
// preparation to work (like have a profile setup in xpcshell tests)
|
||||
|
||||
Cu.import("resource://gre/modules/Webapps.jsm");
|
||||
Cu.import("resource://gre/modules/AppsUtils.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://gre/modules/MessageBroadcaster.jsm");
|
||||
|
||||
this.appsChild = {};
|
||||
Cu.import("resource://gre/modules/AppsServiceChild.jsm", this.appsChild);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
var { Ci, Cu } = require("chrome");
|
||||
var Services = require("Services");
|
||||
var { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
var promise = require("promise");
|
||||
var {
|
||||
ActorPool, createExtraActors, appendExtraActors, GeneratedLocation
|
||||
|
@ -18,8 +19,6 @@ var { assert } = DevToolsUtils;
|
|||
var { TabSources } = require("./utils/TabSources");
|
||||
var makeDebugger = require("./utils/make-debugger");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
loader.lazyRequireGetter(this, "RootActor", "devtools/server/actors/root", true);
|
||||
loader.lazyRequireGetter(this, "ThreadActor", "devtools/server/actors/script", true);
|
||||
loader.lazyRequireGetter(this, "unwrapDebuggerObjectGlobal", "devtools/server/actors/script", true);
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
var { Ci, Cu } = require("chrome");
|
||||
var { DebuggerServer } = require("devtools/server/main");
|
||||
var Services = require("Services");
|
||||
const { Ci } = require("chrome");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
const Services = require("Services");
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const protocol = require("devtools/shared/protocol");
|
||||
const { Arg, method, RetVal } = protocol;
|
||||
const {
|
||||
|
@ -12,8 +17,6 @@ const {
|
|||
|
||||
loader.lazyRequireGetter(this, "ChromeUtils");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(
|
||||
this, "wdm",
|
||||
"@mozilla.org/dom/workers/workerdebuggermanager;1",
|
||||
|
|
|
@ -24,6 +24,8 @@ const { require, loader } = Cu.import("resource://devtools/shared/Loader.jsm", {
|
|||
const { worker } = Cu.import("resource://devtools/shared/worker/loader.js", {});
|
||||
const promise = require("promise");
|
||||
const { Task } = require("devtools/shared/task");
|
||||
const { console } = require("resource://gre/modules/Console.jsm");
|
||||
const { NetUtil } = require("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
const Services = require("Services");
|
||||
// Always log packets when running tests. runxpcshelltests.py will throw
|
||||
|
@ -235,19 +237,6 @@ function dumpn(msg) {
|
|||
dump("DBG-TEST: " + msg + "\n");
|
||||
}
|
||||
|
||||
function tryImport(url) {
|
||||
try {
|
||||
Cu.import(url);
|
||||
} catch (e) {
|
||||
dumpn("Error importing " + url);
|
||||
dumpn(DevToolsUtils.safeErrorString(e));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
tryImport("resource://devtools/shared/Loader.jsm");
|
||||
tryImport("resource://gre/modules/Console.jsm");
|
||||
|
||||
function testExceptionHook(ex) {
|
||||
try {
|
||||
do_report_unexpected_exception(ex);
|
||||
|
@ -492,8 +481,6 @@ function getFilePath(aName, aAllowMissing = false, aUsePlatformPathSeparator = f
|
|||
return path;
|
||||
}
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
/**
|
||||
* Returns the full text contents of the given file.
|
||||
*/
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test that we can tell the memory actor to take a heap snapshot over the RDP
|
||||
// and then create a HeapSnapshot instance from the resulting file.
|
||||
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
const { OS } = require("resource://gre/modules/osfile.jsm");
|
||||
|
||||
const run_test = makeMemoryActorTest(function* (client, memoryFront) {
|
||||
const snapshotFilePath = yield memoryFront.saveHeapSnapshot();
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test that we can properly stream heap snapshot files over the RDP as bulk
|
||||
// data.
|
||||
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
const { OS } = require("resource://gre/modules/osfile.jsm");
|
||||
|
||||
const run_test = makeMemoryActorTest(function* (client, memoryFront) {
|
||||
const snapshotFilePath = yield memoryFront.saveHeapSnapshot({
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test that we can save full runtime heap snapshots when attached to the
|
||||
// ChromeActor or a ChildProcessActor.
|
||||
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
const { OS } = require("resource://gre/modules/osfile.jsm");
|
||||
|
||||
const run_test = makeFullRuntimeMemoryActorTest(function* (client, memoryFront) {
|
||||
const snapshotFilePath = yield memoryFront.saveHeapSnapshot();
|
||||
|
|
|
@ -2,15 +2,13 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test the functionality of the BreakpointActorMap object.
|
||||
|
||||
const { BreakpointActorMap, ThreadActor } = require("devtools/server/actors/script");
|
||||
|
||||
function run_test()
|
||||
{
|
||||
Cu.import("resource://gre/modules/jsdebugger.jsm");
|
||||
addDebuggerToGlobal(this);
|
||||
const { BreakpointActorMap } = require("devtools/server/actors/script");
|
||||
|
||||
function run_test() {
|
||||
test_get_actor();
|
||||
test_set_actor();
|
||||
test_delete_actor();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {getRuleText} = devtools.require("devtools/server/actors/styles");
|
||||
const {getRuleText} = require("devtools/server/actors/styles");
|
||||
|
||||
const TEST_DATA = [
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {getTextAtLineColumn} = devtools.require("devtools/server/actors/styles");
|
||||
const {getTextAtLineColumn} = require("devtools/server/actors/styles");
|
||||
|
||||
const TEST_DATA = [
|
||||
{
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { LongStringActor } = require("devtools/server/actors/object");
|
||||
|
||||
function run_test()
|
||||
{
|
||||
Cu.import("resource://gre/modules/jsdebugger.jsm");
|
||||
addDebuggerToGlobal(this);
|
||||
|
||||
function run_test() {
|
||||
test_LSA_disconnect();
|
||||
test_LSA_grip();
|
||||
test_LSA_onSubstring();
|
||||
|
|
|
@ -8,10 +8,8 @@
|
|||
* Manages the addon-sdk loader instance used to load the developer tools.
|
||||
*/
|
||||
|
||||
var { Constructor: CC, classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var { utils: Cu } = Components;
|
||||
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
var { Loader, descriptor, resolveURI } = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["DevToolsLoader", "devtools", "BuiltinProvider",
|
||||
|
@ -53,7 +51,7 @@ BuiltinProvider.prototype = {
|
|||
// But we have to keep using Promise.jsm for other loader to prevent
|
||||
// breaking unhandled promise rejection in tests.
|
||||
if (this.invisibleToDebugger) {
|
||||
paths["promise"] = "resource://gre/modules/Promise-backend.js";
|
||||
paths.promise = "resource://gre/modules/Promise-backend.js";
|
||||
}
|
||||
this.loader = new Loader.Loader({
|
||||
id: "fx-devtools",
|
||||
|
@ -96,9 +94,9 @@ DevToolsLoader.prototype = {
|
|||
get id() {
|
||||
if (this._id) {
|
||||
return this._id;
|
||||
} else {
|
||||
return this._id = ++gNextLoaderID;
|
||||
}
|
||||
this._id = ++gNextLoaderID;
|
||||
return this._id;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -140,7 +138,7 @@ DevToolsLoader.prototype = {
|
|||
// Promise-backend.js, as a Loader module. Instead of Promise.jsm which
|
||||
// can't be flagged as invisible to debugger.
|
||||
if (this.invisibleToDebugger) {
|
||||
delete modules["promise"];
|
||||
delete modules.promise;
|
||||
}
|
||||
|
||||
// Register custom pseudo modules to the current loader instance
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Console.jsm");
|
||||
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const { console } = require("resource://gre/modules/Console.jsm");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
const acorn = require("acorn/acorn");
|
||||
Cu.import("resource://gre/modules/reflect.jsm");
|
||||
const { Reflect } = require("resource://gre/modules/reflect.jsm");
|
||||
|
||||
const testCode = "" + function main () {
|
||||
function makeAcc(n) {
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
const {Ci, Cc, Cu, Cr} = require("chrome");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
const {NetUtil} = Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
const Services = require("Services");
|
||||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {Ci, Cc, Cr} = require("chrome");
|
||||
const {OS} = require("resource://gre/modules/osfile.jsm");
|
||||
const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
const {NetUtil} = require("resource://gre/modules/NetUtil.jsm");
|
||||
const promise = require("promise");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cu = Components.utils;
|
||||
|
@ -9,8 +11,8 @@ const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
|||
const { DebuggerClient } = require("devtools/shared/client/main");
|
||||
const { DebuggerServer } = require("devtools/server/main");
|
||||
const Services = require("Services");
|
||||
const { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { FileUtils } = require("resource://gre/modules/FileUtils.jsm");
|
||||
const { NetUtil } = require("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
var gClient, gActor;
|
||||
|
||||
|
@ -152,7 +154,7 @@ addMessageListener("addFrame", function (aMessage) {
|
|||
|
||||
addMessageListener("tweak-app-object", function (aMessage) {
|
||||
let appId = aMessage.appId;
|
||||
Cu.import("resource://gre/modules/Webapps.jsm");
|
||||
let { DOMApplicationRegistry } = Cu.import("resource://gre/modules/Webapps.jsm", {});
|
||||
let reg = DOMApplicationRegistry;
|
||||
if ("removable" in aMessage) {
|
||||
reg.webapps[appId].removable = aMessage.removable;
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
var Cc = Components.classes;
|
||||
"use strict";
|
||||
|
||||
var Ci = Components.interfaces;
|
||||
var Cu = Components.utils;
|
||||
var Cr = Components.results;
|
||||
var CC = Components.Constructor;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const Services = require("Services");
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const {FileUtils} = require("resource://gre/modules/FileUtils.jsm");
|
||||
const {DebuggerClient} = require("devtools/shared/client/main");
|
||||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const {AppActorFront} = require("devtools/shared/apps/app-actor-front");
|
||||
|
@ -121,5 +121,3 @@ function do_get_webappsdir() {
|
|||
};
|
||||
Services.dirsvc.QueryInterface(Ci.nsIDirectoryService).registerProvider(provider);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -222,6 +222,13 @@ defineLazyGetter(exports.modules, "CSS", () => {
|
|||
return sandbox.CSS;
|
||||
});
|
||||
|
||||
defineLazyGetter(exports.modules, "FileReader", () => {
|
||||
let sandbox
|
||||
= Cu.Sandbox(CC("@mozilla.org/systemprincipal;1", "nsIPrincipal")(),
|
||||
{wantGlobalProperties: ["FileReader"]});
|
||||
return sandbox.FileReader;
|
||||
});
|
||||
|
||||
// List of all custom globals exposed to devtools modules.
|
||||
// Changes here should be mirrored to devtools/.eslintrc.
|
||||
const globals = exports.globals = {
|
||||
|
|
|
@ -58,7 +58,7 @@ XPCOMUtils.defineLazyGetter(this, "sysInfo", () => {
|
|||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "libcutils", function () {
|
||||
Cu.import("resource://gre/modules/systemlibs.js");
|
||||
let { libcutils } = Cu.import("resource://gre/modules/systemlibs.js", {});
|
||||
return libcutils;
|
||||
});
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { Cc, Ci, Cu } = require("chrome");
|
||||
const { Cu } = require("chrome");
|
||||
const l10n = require("gcli/l10n");
|
||||
const gcli = require("gcli/index");
|
||||
const Debugger = require("Debugger");
|
||||
|
@ -117,9 +117,8 @@ exports.items = [
|
|||
|
||||
if (args.sourceType == "jsm") {
|
||||
try {
|
||||
globalObj = Cu.import(args.source);
|
||||
}
|
||||
catch (e) {
|
||||
globalObj = Cu.import(args.source, {});
|
||||
} catch (e) {
|
||||
return l10n.lookup("callLogChromeInvalidJSM");
|
||||
}
|
||||
} else if (args.sourceType == "content-variable") {
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
const { Ci, Cc } = require("chrome");
|
||||
const l10n = require("gcli/l10n");
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "cookieMgr", function() {
|
||||
return Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
|
||||
|
@ -43,7 +44,7 @@ function sanitizeHost(host) {
|
|||
/**
|
||||
* The cookie 'expires' value needs converting into something more readable.
|
||||
*
|
||||
* And the unit of expires is sec, the unit that in argument of Date() needs
|
||||
* And the unit of expires is sec, the unit that in argument of Date() needs
|
||||
* millisecond.
|
||||
*/
|
||||
function translateExpires(expires) {
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
|
||||
const l10n = require("gcli/l10n");
|
||||
const Services = require("Services");
|
||||
const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
require("devtools/server/actors/inspector");
|
||||
const {
|
||||
BoxModelHighlighter,
|
||||
HighlighterEnvironment
|
||||
} = require("devtools/server/actors/highlighters");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "nodesSelected", function() {
|
||||
XPCOMUtils.defineLazyGetter(this, "nodesSelected", function () {
|
||||
return Services.strings.createBundle("chrome://devtools-shared/locale/gclicommands.properties");
|
||||
});
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cu = Components.utils;
|
||||
var Cr = Components.results;
|
||||
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
const {require, DevToolsLoader, devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
||||
DevToolsUtils.testing = true;
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const { console, ConsoleAPI } = Cu.import("resource://gre/modules/Console.jsm");
|
||||
"use strict";
|
||||
|
||||
const { console, ConsoleAPI } = require("resource://gre/modules/Console.jsm");
|
||||
const { ConsoleAPIListener } = require("devtools/shared/webconsole/utils");
|
||||
const Services = require("Services");
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const defer = require("devtools/shared/defer");
|
||||
|
||||
function testResolve() {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
// Tests for DevToolsUtils.fetch on file:// URI's.
|
||||
|
||||
const { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
const { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
|
||||
const { OS } = Cu.import("resource://gre/modules/osfile.jsm", {});
|
||||
|
||||
const TEST_CONTENT = "aéd";
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче