summaryrefslogtreecommitdiffstats
path: root/devtools/client/storage/ui.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-02 13:36:16 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-02 13:36:16 +0100
commit390894c822f1b163f16744646372a28c0d93a89e (patch)
tree29b6368ffd292bafcc098a0215cb83d0a7a925ec /devtools/client/storage/ui.js
parente272829137195b46612b7664c9416364089f7baa (diff)
downloadUXP-390894c822f1b163f16744646372a28c0d93a89e.tar
UXP-390894c822f1b163f16744646372a28c0d93a89e.tar.gz
UXP-390894c822f1b163f16744646372a28c0d93a89e.tar.lz
UXP-390894c822f1b163f16744646372a28c0d93a89e.tar.xz
UXP-390894c822f1b163f16744646372a28c0d93a89e.zip
Bug 1146194: Multiple cookies with the same name not shown
Issue #31
Diffstat (limited to 'devtools/client/storage/ui.js')
-rw-r--r--devtools/client/storage/ui.js32
1 files changed, 22 insertions, 10 deletions
diff --git a/devtools/client/storage/ui.js b/devtools/client/storage/ui.js
index 6af493e44..c4dd57c6e 100644
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -12,6 +12,12 @@ const {KeyShortcuts} = require("devtools/client/shared/key-shortcuts");
const JSOL = require("devtools/client/shared/vendor/jsol");
const {KeyCodes} = require("devtools/client/shared/keycodes");
+// GUID to be used as a separator in compound keys. This must match the same
+// constant in devtools/server/actors/storage.js,
+// devtools/client/storage/test/head.js and
+// devtools/server/tests/browser/head.js
+const SEPARATOR_GUID = "{9d414cc5-8319-0a04-0586-c0a6ae01670a}";
+
loader.lazyRequireGetter(this, "TreeWidget",
"devtools/client/shared/widgets/TreeWidget", true);
loader.lazyRequireGetter(this, "TableWidget",
@@ -36,13 +42,6 @@ const GENERIC_VARIABLES_VIEW_SETTINGS = {
preventDescriptorModifiers: true
};
-// Columns which are hidden by default in the storage table
-const HIDDEN_COLUMNS = [
- "creationTime",
- "isDomain",
- "isSecure"
-];
-
const REASON = {
NEW_ROW: "new-row",
NEXT_50_ITEMS: "next-50-items",
@@ -786,6 +785,8 @@ StorageUI.prototype = {
let uniqueKey = null;
let columns = {};
let editableFields = [];
+ let hiddenFields = [];
+ let privateFields = [];
let fields = yield this.getCurrentActor().getFields(subtype);
fields.forEach(f => {
@@ -797,6 +798,14 @@ StorageUI.prototype = {
editableFields.push(f.name);
}
+ if (f.hidden) {
+ hiddenFields.push(f.name);
+ }
+
+ if (f.private) {
+ privateFields.push(f.name);
+ }
+
columns[f.name] = f.name;
let columnName;
try {
@@ -812,7 +821,7 @@ StorageUI.prototype = {
}
});
- this.table.setColumns(columns, null, HIDDEN_COLUMNS);
+ this.table.setColumns(columns, null, hiddenFields, privateFields);
this.hideSidebar();
yield this.makeFieldsEditable(editableFields);
@@ -927,10 +936,13 @@ StorageUI.prototype = {
let rowId = this.table.contextMenuRowId;
let data = this.table.items.get(rowId);
- let name = addEllipsis(data[this.table.uniqueId]);
+ let name = data[this.table.uniqueId];
+
+ let separatorRegex = new RegExp(SEPARATOR_GUID, "g");
+ let label = addEllipsis((name + "").replace(separatorRegex, "-"));
this._tablePopupDelete.setAttribute("label",
- L10N.getFormatStr("storage.popupMenu.deleteLabel", name));
+ L10N.getFormatStr("storage.popupMenu.deleteLabel", label));
if (type === "cookies") {
let host = addEllipsis(data.host);