diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-03-02 10:32:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-02 10:32:45 +0100 |
commit | e272829137195b46612b7664c9416364089f7baa (patch) | |
tree | 20b543048260952a2c4ac8bb4cb22aaaa684bd84 /devtools/shared/gcli | |
parent | ba2c2e5301bb2d993984c62cdf2fd07b361e6bca (diff) | |
parent | c8355b22c047c9737e32f096b816edbb8b0fa181 (diff) | |
download | UXP-e272829137195b46612b7664c9416364089f7baa.tar UXP-e272829137195b46612b7664c9416364089f7baa.tar.gz UXP-e272829137195b46612b7664c9416364089f7baa.tar.lz UXP-e272829137195b46612b7664c9416364089f7baa.tar.xz UXP-e272829137195b46612b7664c9416364089f7baa.zip |
Merge pull request #34 from janekptacijarabaci/devtools_import-from-moebius_1
Port across devtools enhancements
Diffstat (limited to 'devtools/shared/gcli')
-rw-r--r-- | devtools/shared/gcli/commands/cmd.js | 4 | ||||
-rw-r--r-- | devtools/shared/gcli/commands/cookie.js | 22 | ||||
-rw-r--r-- | devtools/shared/gcli/commands/screenshot.js | 6 | ||||
-rw-r--r-- | devtools/shared/gcli/source/lib/gcli/commands/help.js | 4 |
4 files changed, 21 insertions, 15 deletions
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/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({ 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) { 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 = [ ' <div if="${command.isParent}">\n' + ' <p class="gcli-help-header">${l10n.subCommands}:</p>\n' + ' <ul class="gcli-help-${subcommands}">\n' + - ' <li if="${subcommands.length === 0}">${l10n.subcommandsNone}</li>\n' + + ' <li if="${subcommands.length === 0}">${l10n.subCommandsNone}</li>\n' + ' <li foreach="subcommand in ${subcommands}">\n' + ' ${subcommand.name}: ${subcommand.description}\n' + ' <span class="gcli-out-shortcut" data-command="help ${subcommand.name}"\n' + @@ -321,7 +321,7 @@ exports.items = [ '\n' + '<span if="${command.isParent}"># ${l10n.subCommands}:</span>\n' + '\n' + - '<span if="${subcommands.length === 0}">${l10n.subcommandsNone}</span>\n' + + '<span if="${subcommands.length === 0}">${l10n.subCommandsNone}</span>\n' + '<loop foreach="subcommand in ${subcommands}">* ${subcommand.name}: ${subcommand.description}\n' + '</loop>\n' + '</div>\n', |