From ad35e2a11f30dd2db1ae63431dbb9065eea2771c Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 28 Feb 2018 08:41:33 +0100 Subject: DevTools - gcli commands - cookie https://github.com/MoonchildProductions/moebius/pull/55 --- devtools/shared/gcli/commands/cookie.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'devtools/shared') diff --git a/devtools/shared/gcli/commands/cookie.js b/devtools/shared/gcli/commands/cookie.js index f1680042f..203ac738c 100644 --- a/devtools/shared/gcli/commands/cookie.js +++ b/devtools/shared/gcli/commands/cookie.js @@ -100,7 +100,7 @@ exports.items = [ let cookies = []; while (enm.hasMoreElements()) { - let cookie = enm.getNext().QueryInterface(Ci.nsICookie); + let cookie = enm.getNext().QueryInterface(Ci.nsICookie2); if (isCookieAtHost(cookie, host)) { cookies.push({ host: cookie.host, @@ -108,9 +108,10 @@ exports.items = [ value: cookie.value, path: cookie.path, expires: cookie.expires, - secure: cookie.secure, - httpOnly: cookie.httpOnly, - sameDomain: cookie.sameDomain + isDomain: cookie.isDomain, + isHttpOnly: cookie.isHttpOnly, + isSecure: cookie.isSecure, + isSession: cookie.isSession, }); } } @@ -169,11 +170,14 @@ exports.items = [ for (let cookie of cookies) { cookie.expires = translateExpires(cookie.expires); - let noAttrs = !cookie.secure && !cookie.httpOnly && !cookie.sameDomain; - cookie.attrs = (cookie.secure ? "secure" : " ") + - (cookie.httpOnly ? "httpOnly" : " ") + - (cookie.sameDomain ? "sameDomain" : " ") + - (noAttrs ? l10n.lookup("cookieListOutNone") : " "); + let noAttrs = !cookie.isDomain && !cookie.isHttpOnly && + !cookie.isSecure && !cookie.isSession; + cookie.attrs = ((cookie.isDomain ? "isDomain " : "") + + (cookie.isHttpOnly ? "isHttpOnly " : "") + + (cookie.isSecure ? "isSecure " : "") + + (cookie.isSession ? "isSession " : "") + + (noAttrs ? l10n.lookup("cookieListOutNone") : "")) + .trim(); } return context.createView({ -- cgit v1.2.3 From f7e146b34388db880d34d4d8082d71f903c6cabe Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 28 Feb 2018 08:51:01 +0100 Subject: [partial fix] DevTools - network - proxy - throws an errors (remoteAddress) https://github.com/MoonchildProductions/moebius/pull/63 --- devtools/shared/webconsole/network-monitor.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'devtools/shared') diff --git a/devtools/shared/webconsole/network-monitor.js b/devtools/shared/webconsole/network-monitor.js index 084493432..5416a7760 100644 --- a/devtools/shared/webconsole/network-monitor.js +++ b/devtools/shared/webconsole/network-monitor.js @@ -1327,8 +1327,24 @@ NetworkMonitor.prototype = { let response = {}; response.httpVersion = statusLineArray.shift(); - response.remoteAddress = httpActivity.channel.remoteAddress; - response.remotePort = httpActivity.channel.remotePort; + // XXX: + // Sometimes, when using a proxy server (manual proxy configuration), + // throws an errors: + // 0x80040111 (NS_ERROR_NOT_AVAILABLE) + // [nsIHttpChannelInternal.remoteAddress] + // Bug 1337791 is the suspect. + response.remoteAddress = null; + try { + response.remoteAddress = httpActivity.channel.remoteAddress; + } catch (e) { + Cu.reportError(e); + } + response.remotePort = null; + try { + response.remotePort = httpActivity.channel.remotePort; + } catch (e) { + Cu.reportError(e); + } response.status = statusLineArray.shift(); response.statusText = statusLineArray.join(" "); response.headersSize = extraStringData.length; -- cgit v1.2.3 From b19e4e2cf0c1537c8c2a56d0b783d38b6b25de7f Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 28 Feb 2018 08:57:48 +0100 Subject: DevTools - inspector - data URL source links and their tooltips are unreadable https://github.com/MoonchildProductions/moebius/pull/95 --- devtools/shared/inspector/css-logic.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'devtools/shared') diff --git a/devtools/shared/inspector/css-logic.js b/devtools/shared/inspector/css-logic.js index c8cdd2fdb..901b7a189 100644 --- a/devtools/shared/inspector/css-logic.js +++ b/devtools/shared/inspector/css-logic.js @@ -30,6 +30,8 @@ "use strict"; +const MAX_DATA_URL_LENGTH = 40; + /** * Provide access to the style information in a page. * CssLogic uses the standard DOM API, and the Gecko inIDOMUtils API to access @@ -103,6 +105,13 @@ exports.shortSource = function (sheet) { return exports.l10n("rule.sourceInline"); } + // If the sheet is a data URL, return a trimmed version of it. + let dataUrl = sheet.href.trim().match(/^data:.*?,((?:.|\r|\n)*)$/); + if (dataUrl) { + return dataUrl[1].length > MAX_DATA_URL_LENGTH ? + `${dataUrl[1].substr(0, MAX_DATA_URL_LENGTH - 1)}…` : dataUrl[1]; + } + // We try, in turn, the filename, filePath, query string, whole thing let url = {}; try { @@ -123,8 +132,7 @@ exports.shortSource = function (sheet) { return url.query; } - let dataUrl = sheet.href.match(/^(data:[^,]*),/); - return dataUrl ? dataUrl[1] : sheet.href; + return sheet.href; }; const TAB_CHARS = "\t"; -- cgit v1.2.3 From 228d252ab14f65f8433c8d53122a7d1e9429c23e Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 09:02:37 +0100 Subject: DevTools - network - security (improvements) https://github.com/MoonchildProductions/moebius/pull/113 https://github.com/MoonchildProductions/moebius/pull/118 https://github.com/MoonchildProductions/moebius/pull/127 --- devtools/shared/webconsole/network-helper.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'devtools/shared') diff --git a/devtools/shared/webconsole/network-helper.js b/devtools/shared/webconsole/network-helper.js index af6a2e55b..4e25fac26 100644 --- a/devtools/shared/webconsole/network-helper.js +++ b/devtools/shared/webconsole/network-helper.js @@ -63,6 +63,8 @@ const {components, Cc, Ci} = require("chrome"); loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm"); const DevToolsUtils = require("devtools/shared/DevToolsUtils"); const Services = require("Services"); +const { LocalizationHelper } = require("devtools/shared/l10n"); +const L10N = new LocalizationHelper("devtools/client/locales/netmonitor.properties"); // The cache used in the `nsIURL` function. const gNSURLStore = new Map(); @@ -620,6 +622,31 @@ var NetworkHelper = { // Cipher suite. info.cipherSuite = SSLStatus.cipherName; + // Key exchange group name. + info.keaGroupName = SSLStatus.keaGroupName; + // Localise two special values. + if (info.keaGroupName == "none") { + info.keaGroupName = L10N.getStr("netmonitor.security.keaGroup.none"); + } + if (info.keaGroupName == "custom") { + info.keaGroupName = L10N.getStr("netmonitor.security.keaGroup.custom"); + } + if (info.keaGroupName == "unknown group") { + info.keaGroupName = L10N.getStr("netmonitor.security.keaGroup.unknown"); + } + + // Certificate signature scheme. + info.signatureSchemeName = SSLStatus.signatureSchemeName; + // Localise two special values. + if (info.signatureSchemeName == "none") { + info.signatureSchemeName = + L10N.getStr("netmonitor.security.signatureScheme.none"); + } + if (info.signatureSchemeName == "unknown signature") { + info.signatureSchemeName = + L10N.getStr("netmonitor.security.signatureScheme.unknown"); + } + // Protocol version. info.protocolVersion = this.formatSecurityProtocol(SSLStatus.protocolVersion); -- cgit v1.2.3 From 644e9db1092df1477b1facc52cd3ee45ebd13040 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 11:52:50 +0100 Subject: DevTools - network - implement the secureConnectionStart property for the PerformanceTiming https://github.com/MoonchildProductions/moebius/pull/116 ("/testing" and "/toolkit" in in the previous commit) --- devtools/shared/webconsole/network-monitor.js | 35 ++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'devtools/shared') diff --git a/devtools/shared/webconsole/network-monitor.js b/devtools/shared/webconsole/network-monitor.js index 5416a7760..bda745520 100644 --- a/devtools/shared/webconsole/network-monitor.js +++ b/devtools/shared/webconsole/network-monitor.js @@ -732,7 +732,9 @@ NetworkMonitor.prototype = { 0x804b0004: "STATUS_CONNECTED_TO", 0x804b0005: "STATUS_SENDING_TO", 0x804b000a: "STATUS_WAITING_FOR", - 0x804b0006: "STATUS_RECEIVING_FROM" + 0x804b0006: "STATUS_RECEIVING_FROM", + 0x804b000c: "STATUS_TLS_STARTING", + 0x804b000d: "STATUS_TLS_ENDING" }, httpDownloadActivities: [ @@ -1406,6 +1408,7 @@ NetworkMonitor.prototype = { timings: { blocked: 0, dns: 0, + ssl: 0, connect: 0, send: 0, wait: 0, @@ -1440,6 +1443,36 @@ NetworkMonitor.prototype = { harTimings.connect = -1; } + if (timings.STATUS_TLS_STARTING && timings.STATUS_TLS_ENDING) { + harTimings.ssl = timings.STATUS_TLS_ENDING.last - + timings.STATUS_TLS_STARTING.first; + } else { + harTimings.ssl = -1; + } + + // sometimes the connection information events are attached to a speculative + // channel instead of this one, but necko might glue them back together in the + // nsITimedChannel interface used by Resource and Navigation Timing + let timedChannel = httpActivity.channel.QueryInterface(Ci.nsITimedChannel); + + if ((harTimings.connect <= 0) && timedChannel) { + if (timedChannel.secureConnectionStartTime > timedChannel.connectStartTime) { + harTimings.connect = + timedChannel.secureConnectionStartTime - timedChannel.connectStartTime; + harTimings.ssl = + timedChannel.connectEndTime - timedChannel.secureConnectionStartTime; + } else { + harTimings.connect = + timedChannel.connectEndTime - timedChannel.connectStartTime; + harTimings.ssl = -1; + } + } + + if ((harTimings.dns <= 0) && timedChannel) { + harTimings.dns = + timedChannel.domainLookupEndTime - timedChannel.domainLookupStartTime; + } + if (timings.STATUS_SENDING_TO) { harTimings.send = timings.STATUS_SENDING_TO.last - timings.STATUS_SENDING_TO.first; } else if (timings.REQUEST_HEADER && timings.REQUEST_BODY_SENT) { -- cgit v1.2.3 From 12ea5683594229407ae1852969b6417a59ae16e1 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 13:13:33 +0100 Subject: DevTools - style editor - StyleSheetsActor should use the parent tabActor to retrieve the list of windows and react to new/removed windows https://github.com/MoonchildProductions/moebius/pull/124 --- devtools/shared/specs/stylesheets.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'devtools/shared') diff --git a/devtools/shared/specs/stylesheets.js b/devtools/shared/specs/stylesheets.js index c89a7c088..fc75281f8 100644 --- a/devtools/shared/specs/stylesheets.js +++ b/devtools/shared/specs/stylesheets.js @@ -105,6 +105,14 @@ exports.styleSheetSpec = styleSheetSpec; const styleSheetsSpec = generateActorSpec({ typeName: "stylesheets", + events: { + "stylesheet-added": { + type: "stylesheetAdded", + sheet: Arg(0, "stylesheet"), + isNew: Arg(1, "boolean") + }, + }, + methods: { getStyleSheets: { request: {}, -- cgit v1.2.3 From b43b4f25a8f195da2d54da9ebc5e415fb3b2a133 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 13:30:24 +0100 Subject: DevTools - gcli - screenshot - the vertical mode https://github.com/MoonchildProductions/moebius/pull/166 --- devtools/shared/gcli/commands/screenshot.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'devtools/shared') diff --git a/devtools/shared/gcli/commands/screenshot.js b/devtools/shared/gcli/commands/screenshot.js index e2f38b6d9..11bafcab9 100644 --- a/devtools/shared/gcli/commands/screenshot.js +++ b/devtools/shared/gcli/commands/screenshot.js @@ -277,6 +277,12 @@ function createScreenshotData(document, args) { window.scrollTo(0,0); width = window.innerWidth + window.scrollMaxX - window.scrollMinX; height = window.innerHeight + window.scrollMaxY - window.scrollMinY; + let writingMode = "horizontal-tb"; + if (window.getComputedStyle(document.documentElement)) { + writingMode = window.getComputedStyle(document.documentElement).writingMode; + } + let orientation = writingMode.substring(0, writingMode.indexOf("-")).toLowerCase(); + left = ((orientation != "vertical") ? left : (-width + window.innerWidth)); filename = filename.replace(".png", "-fullpage.png"); } else if (args.selector) { -- cgit v1.2.3 From 0535b0bb38dacf7dab31fd757a91ca9928292693 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 13:57:10 +0100 Subject: Fix "help cmd" and "cmd refresh" in the Developer Toolbar https://github.com/MoonchildProductions/moebius/pull/348 --- devtools/shared/gcli/commands/cmd.js | 4 ---- devtools/shared/gcli/source/lib/gcli/commands/help.js | 4 ++-- devtools/shared/locales/en-US/gcli.properties | 9 +++++++-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'devtools/shared') diff --git a/devtools/shared/gcli/commands/cmd.js b/devtools/shared/gcli/commands/cmd.js index 1777ed960..1b3cb2ecb 100644 --- a/devtools/shared/gcli/commands/cmd.js +++ b/devtools/shared/gcli/commands/cmd.js @@ -137,8 +137,6 @@ exports.items = [ return !prefBranch.prefHasUserValue(PREF_DIR); }, exec: function(args, context) { - gcli.load(); - let dirName = prefBranch.getComplexValue(PREF_DIR, Ci.nsISupportsString).data.trim(); return l10n.lookupFormat("cmdStatus3", [ dirName ]); @@ -170,8 +168,6 @@ exports.items = [ supportsString.data = args.directory; prefBranch.setComplexValue(PREF_DIR, Ci.nsISupportsString, supportsString); - gcli.load(); - return l10n.lookupFormat("cmdStatus3", [ args.directory ]); } } diff --git a/devtools/shared/gcli/source/lib/gcli/commands/help.js b/devtools/shared/gcli/source/lib/gcli/commands/help.js index 7d1cc9087..365c53380 100644 --- a/devtools/shared/gcli/source/lib/gcli/commands/help.js +++ b/devtools/shared/gcli/source/lib/gcli/commands/help.js @@ -275,7 +275,7 @@ exports.items = [ '
\n' + '

${l10n.subCommands}:

\n' + '
    \n' + - '
  • ${l10n.subcommandsNone}
  • \n' + + '
  • ${l10n.subCommandsNone}
  • \n' + '
  • \n' + ' ${subcommand.name}: ${subcommand.description}\n' + ' # ${l10n.subCommands}:\n' + '\n' + - '${l10n.subcommandsNone}\n' + + '${l10n.subCommandsNone}\n' + '* ${subcommand.name}: ${subcommand.description}\n' + '\n' + '
\n', diff --git a/devtools/shared/locales/en-US/gcli.properties b/devtools/shared/locales/en-US/gcli.properties index e5231e44a..59c344832 100644 --- a/devtools/shared/locales/en-US/gcli.properties +++ b/devtools/shared/locales/en-US/gcli.properties @@ -141,9 +141,10 @@ helpManual=Provide help either on a specific command (if a search string is prov helpSearchDesc=Search string helpSearchManual3=search string to use in narrowing down the displayed commands. Regular expressions not supported. -# LOCALIZATION NOTE: These strings are displayed in the help page for a -# command in the console. +# LOCALIZATION NOTE (helpManSynopsis, helpManDescription): These strings are +# displayed in the help page for a command in the console. helpManSynopsis=Synopsis +helpManDescription=Description # LOCALIZATION NOTE: This message is displayed in the help page if the command # has no parameters. @@ -177,6 +178,10 @@ helpIntro=GCLI is an experiment to create a highly usable command line for web d # sub-commands. subCommands=Sub-Commands +# LOCALIZATION NOTE: Text shown as part of the output of the 'help' command +# when the command in question should have sub-commands but in fact has none. +subCommandsNone=None + # LOCALIZATION NOTE: This error message is displayed when the command line is # cannot find a match for the parse types. commandParseError=Command line parsing error -- cgit v1.2.3 From 3777f62a0090bee3b39f20b090b3f1fa8f66b4f7 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 20:38:25 +0100 Subject: Fix nit --- devtools/shared/webconsole/network-monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devtools/shared') diff --git a/devtools/shared/webconsole/network-monitor.js b/devtools/shared/webconsole/network-monitor.js index bda745520..a55162f52 100644 --- a/devtools/shared/webconsole/network-monitor.js +++ b/devtools/shared/webconsole/network-monitor.js @@ -1331,7 +1331,7 @@ NetworkMonitor.prototype = { response.httpVersion = statusLineArray.shift(); // XXX: // Sometimes, when using a proxy server (manual proxy configuration), - // throws an errors: + // throws an error: // 0x80040111 (NS_ERROR_NOT_AVAILABLE) // [nsIHttpChannelInternal.remoteAddress] // Bug 1337791 is the suspect. -- cgit v1.2.3