loader.lazyGetter(this, "GetStringFromName", () => { let bundle = Services.strings.createBundle( "chrome://devtools/locale/inspector.properties"); return key => { return bundle.GetStringFromName(key); }; });
function l10n(name) { const bundle = Services.strings.createBundle("chrome://devtools/locale/toolbox.properties"); try { return bundle.GetStringFromName(name); } catch (e) { throw new Error("Failed loading l10n string: " + name); } }
XPCOMUtils.defineLazyGetter(this, "l10n", function() { let bundle = Services.strings.createBundle("chrome://devtools/locale/toolbox.properties"); let l10n = function(name, ...aArgs) { try { if (aArgs.length == 0) { return bundle.GetStringFromName(name); } return bundle.formatStringFromName(name, aArgs, aArgs.length); } catch (ex) { Services.console.logStringMessage("Error reading '" + name + "'"); } }; return l10n; });
* See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; var Cc = require('chrome').Cc; var Ci = require('chrome').Ci; var Cu = require('chrome').Cu; var prefSvc = Cc['@mozilla.org/preferences-service;1'] .getService(Ci.nsIPrefService); var prefBranch = prefSvc.getBranch(null).QueryInterface(Ci.nsIPrefBranch); var Services = require("Services"); var stringBundle = Services.strings.createBundle( 'chrome://devtools-shared/locale/gclicommands.properties'); /** * Lookup a string in the GCLI string bundle */ exports.lookup = function(name) { try { return stringBundle.GetStringFromName(name); } catch (ex) { throw new Error('Failure in lookup(\'' + name + '\')'); } }; /** * An alternative to lookup().
/* 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 {utils: Cu, interfaces: Ci} = Components; Cu.import("resource:///modules/devtools/gDevTools.jsm"); const {require} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}); const {Toolbox} = require("devtools/framework/toolbox"); const {ConnectionManager, Connection} = require("devtools/client/connection-manager"); const promise = require("devtools/toolkit/deprecated-sync-thenables"); const prefs = require("sdk/preferences/service"); const Services = require("Services"); const Strings = Services.strings.createBundle("chrome://browser/locale/devtools/app-manager.properties"); var UI = { _toolboxTabCursor: 0, _handledTargets: new Map(), connection: null, init: function() { this.onLoad = this.onLoad.bind(this); this.onUnload = this.onUnload.bind(this); this.onMessage = this.onMessage.bind(this); this.onConnected = this.onConnected.bind(this); this.onDisconnected = this.onDisconnected.bind(this); window.addEventListener("load", this.onLoad); window.addEventListener("unload", this.onUnload); window.addEventListener("message", this.onMessage); },
loader.lazyGetter(this, "netMonitorStrings", () => Services.strings.createBundle(netMonitorProps));
loader.lazyGetter(this, "scratchpadStrings", () => Services.strings.createBundle(scratchpadProps));
loader.lazyGetter(this, "shaderEditorStrings", () => Services.strings.createBundle(shaderEditorProps));
loader.lazyGetter(this, "webAudioEditorStrings", () => Services.strings.createBundle(webAudioEditorProps));
loader.lazyGetter(this, "_strings", () => { return Services.strings .createBundle("chrome://devtools-shared/locale/styleinspector.properties"); });
loader.lazyGetter(this, "performanceStrings", () => Services.strings.createBundle(performanceProps));
loader.lazyGetter(this, "toolboxStrings", function () { return Services.strings.createBundle("chrome://devtools/locale/toolbox.properties"); });
const promise = require("promise"); const Telemetry = require("devtools/client/shared/telemetry"); const { gDevTools } = require("./devtools"); const { when: unload } = require("sdk/system/unload"); // Load target and toolbox lazily as they need gDevTools to be fully initialized loader.lazyRequireGetter(this, "TargetFactory", "devtools/client/framework/target", true); loader.lazyRequireGetter(this, "Toolbox", "devtools/client/framework/toolbox", true); loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true); loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true); loader.lazyRequireGetter(this, "BrowserMenus", "devtools/client/framework/browser-menus"); loader.lazyImporter(this, "CustomizableUI", "resource:///modules/CustomizableUI.jsm"); loader.lazyImporter(this, "AppConstants", "resource://gre/modules/AppConstants.jsm"); const bundle = Services.strings.createBundle("chrome://devtools/locale/toolbox.properties"); const TABS_OPEN_PEAK_HISTOGRAM = "DEVTOOLS_TABS_OPEN_PEAK_LINEAR"; const TABS_OPEN_AVG_HISTOGRAM = "DEVTOOLS_TABS_OPEN_AVERAGE_LINEAR"; const TABS_PINNED_PEAK_HISTOGRAM = "DEVTOOLS_TABS_PINNED_PEAK_LINEAR"; const TABS_PINNED_AVG_HISTOGRAM = "DEVTOOLS_TABS_PINNED_AVERAGE_LINEAR"; /** * gDevToolsBrowser exposes functions to connect the gDevTools instance with a * Firefox instance. */ var gDevToolsBrowser = exports.gDevToolsBrowser = { /** * A record of the windows whose menus we altered, so we can undo the changes * as the window is closed */
/* 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, CC} = require("chrome"); const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm", {}); const Services = require("Services"); const {Task} = require("devtools/shared/task"); var XMLHttpRequest = CC("@mozilla.org/xmlextras/xmlhttprequest;1"); var strings = Services.strings.createBundle("chrome://devtools/locale/app-manager.properties"); function AppValidator({ type, location }) { this.type = type; this.location = location; this.errors = []; this.warnings = []; } AppValidator.prototype.error = function (message) { this.errors.push(message); }; AppValidator.prototype.warning = function (message) { this.warnings.push(message); }; AppValidator.prototype._getPackagedManifestFile = function () { let manifestFile = FileUtils.File(this.location); if (!manifestFile.exists()) {
loader.lazyGetter(L10N.prototype, "strings", () => { return Services.strings.createBundle( "chrome://devtools/locale/inspector.properties"); });
loader.lazyGetter(this, "l10n", () => Services.strings .createBundle("chrome://devtools/locale/eyedropper.properties"));
* 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 { AddonManager } = require("resource://gre/modules/AddonManager.jsm"); const { createFactory, createClass, DOM: dom } = require("devtools/client/shared/vendor/react"); const Services = require("Services"); const AddonsControls = createFactory(require("./addons-controls")); const AddonTarget = createFactory(require("./addon-target")); const TabHeader = createFactory(require("./tab-header")); const TargetList = createFactory(require("./target-list")); const Strings = Services.strings.createBundle( "chrome://devtools/locale/aboutdebugging.properties"); const ExtensionIcon = "chrome://mozapps/skin/extensions/extensionGeneric.svg"; const CHROME_ENABLED_PREF = "devtools.chrome.enabled"; const REMOTE_ENABLED_PREF = "devtools.debugger.remote-enabled"; module.exports = createClass({ displayName: "AddonsTab", getInitialState() { return { extensions: [], debugDisabled: false, }; },
loader.lazyGetter(this, "jsonViewStrings", () => { return Services.strings.createBundle( "chrome://devtools/locale/jsonview.properties"); });
loader.lazyGetter(this, "toolboxStrings", () => Services.strings.createBundle(toolboxProps));
XPCOMUtils.defineLazyGetter(window, "l10n", function () { return Services.strings.createBundle("chrome://devtools/locale/connection-screen.properties"); });
loader.lazyGetter(this, "webConsoleStrings", () => Services.strings.createBundle(webConsoleProps));
lookup: function (msg) { if (this._stringBundle == null) { this._stringBundle = Services.strings.createBundle(this._URI); } return this._stringBundle.GetStringFromName(msg); }
loader.lazyGetter(this, "canvasDebuggerStrings", () => Services.strings.createBundle(canvasDebuggerProps));
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const Services = require("Services"); const {FileUtils} = require("resource://gre/modules/FileUtils.jsm"); const EventEmitter = require("devtools/shared/event-emitter"); const {OS} = require("resource://gre/modules/osfile.jsm"); const {AppProjects} = require("devtools/client/webide/modules/app-projects"); const TabStore = require("devtools/client/webide/modules/tab-store"); const {AppValidator} = require("devtools/client/webide/modules/app-validator"); const {ConnectionManager, Connection} = require("devtools/shared/client/connection-manager"); const {RuntimeScanners} = require("devtools/client/webide/modules/runtimes"); const {RuntimeTypes} = require("devtools/client/webide/modules/runtime-types"); const {NetUtil} = require("resource://gre/modules/NetUtil.jsm"); const Telemetry = require("devtools/client/shared/telemetry"); const Strings = Services.strings.createBundle("chrome://devtools/locale/webide.properties"); var AppManager = exports.AppManager = { DEFAULT_PROJECT_ICON: "chrome://webide/skin/default-app-icon.png", DEFAULT_PROJECT_NAME: "--", _initialized: false, init: function() { if (this._initialized) { return; } this._initialized = true; const port = Services.prefs.getIntPref("devtools.debugger.remote-port");
loader.lazyGetter(this, "inspectorStrings", () => Services.strings.createBundle(inspectorProps));
XPCOMUtils.defineLazyGetter(CssComputedView, "_strings", function () { return Services.strings.createBundle( "chrome://devtools-shared/locale/styleinspector.properties"); });
loader.lazyGetter(this, "storageStrings", () => Services.strings.createBundle(storageProps));
() => Services.strings.createBundle("chrome://devtools/locale/eyedropper.properties"));
loader.lazyGetter(this, "memoryStrings", () => Services.strings.createBundle(memoryProps));
MATCHED: 2, PARENT_MATCH: 1, UNMATCHED: 0, UNKNOWN: -1, }; /** * Memoized lookup of a l10n string from a string bundle. * @param {string} name The key to lookup. * @returns A localized version of the given key. */ exports.l10n = function (name) { return exports._strings.GetStringFromName(name); }; exports._strings = Services.strings .createBundle("chrome://devtools-shared/locale/styleinspector.properties"); /** * Is the given property sheet a content stylesheet? * * @param {CSSStyleSheet} sheet a stylesheet * @return {boolean} true if the given stylesheet is a content stylesheet, * false otherwise. */ exports.isContentStylesheet = function (sheet) { return sheet.parsingMode !== "agent"; }; /** * Return a shortened version of a style sheet's source. *