mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
moebius#339: Make it possible to add cookies, local and session storage entries
Issue #31 https://github.com/MoonchildProductions/moebius/pull/339
This commit is contained in:
parent
e688e88257
commit
6d865bfda3
13 changed files with 309 additions and 43 deletions
|
|
@ -897,3 +897,39 @@ function setPermission(url, permission) {
|
|||
.addFromPrincipal(principal, permission,
|
||||
nsIPermissionManager.ALLOW_ACTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item.
|
||||
* @param {Array} store
|
||||
* An array containing the path to the store to which we wish to add an
|
||||
* item.
|
||||
*/
|
||||
function* performAdd(store) {
|
||||
let storeName = store.join(" > ");
|
||||
let toolbar = gPanelWindow.document.getElementById("storage-toolbar");
|
||||
let type = store[0];
|
||||
|
||||
yield selectTreeItem(store);
|
||||
|
||||
let menuAdd = toolbar.querySelector(
|
||||
"#add-button");
|
||||
|
||||
if (menuAdd.hidden) {
|
||||
is(menuAdd.hidden, false,
|
||||
`performAdd called for ${storeName} but it is not supported`);
|
||||
return;
|
||||
}
|
||||
|
||||
let eventEdit = gUI.table.once("row-edit");
|
||||
let eventWait = gUI.once("store-objects-updated");
|
||||
|
||||
menuAdd.click();
|
||||
|
||||
let rowId = yield eventEdit;
|
||||
yield eventWait;
|
||||
|
||||
let key = type === "cookies" ? "uniqueKey" : "name";
|
||||
let value = getCellValue(rowId, key);
|
||||
|
||||
is(rowId, value, `Row '${rowId}' was successfully added.`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue