Bug 209867 - Web Inspector: Storage: cannot clear out multiple or all local storage entries
Summary: Web Inspector: Storage: cannot clear out multiple or all local storage entries
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: Safari 13
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-01 11:18 PDT by Jon Lee
Modified: 2020-04-22 14:51 PDT (History)
11 users (show)

See Also:


Attachments
Patch (35.72 KB, patch)
2020-04-05 20:22 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Lee 2020-04-01 11:18:30 PDT
I'd like to be able to delete multiple key/values pairs in local storage in WI.

This breaks down to a few requests:
- Allow selection of multiple rows
- Command-A to select all rows
- A button to clear all local storage
- Right click on "Local Storage" in the left sidebar with option to "Clear All Items"
Comment 1 Jon Lee 2020-04-01 11:22:54 PDT
Also, if I select a row, and then press delete, it doesn't by default select the next row. So I can't mash the delete key to remove a series of key/value pairs, either.
Comment 2 Jon Lee 2020-04-01 11:24:05 PDT
A good place to test this is to load

https://browserbench.org/MotionMark/developer.html

and press "Run benchmark". That will set entries.
Comment 3 Devin Rousso 2020-04-01 13:04:31 PDT
(In reply to Jon Lee from comment #0)
> - Allow selection of multiple rows
> - Command-A to select all rows
These both should be solved if we switch from `WI.DataGrid` to `WI.Table`.  We'd need to either add logic to `WI.Table` to support editing by default, or add custom logic to `WI.DOMStorageContentView` for editing.

> - A button to clear all local storage
> - Right click on "Local Storage" in the left sidebar with option to "Clear All Items"
We could do this with a new protocol command (i.e. `DOMStorage.clearDOMStorageItems` like `IndexedDB.clearObjectStore`), but we could also do this by successively calling `DOMStorage.removeDOMStorageItem` with each item.  This would be a lot of protocol traffic, but it would be backwards compatible.

We may want to extend many of these to `IndexedDB` as well :)
Comment 4 Devin Rousso 2020-04-05 20:22:36 PDT
Created attachment 395542 [details]
Patch
Comment 5 EWS Watchlist 2020-04-05 20:23:27 PDT
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Comment 6 EWS 2020-04-08 12:16:39 PDT
Committed r259744: <https://trac.webkit.org/changeset/259744>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395542 [details].
Comment 7 Radar WebKit Bug Importer 2020-04-08 12:17:14 PDT
<rdar://problem/61469103>
Comment 8 Jon Lee 2020-04-22 14:50:02 PDT
(In reply to Devin Rousso from comment #3)
> (In reply to Jon Lee from comment #0)
> > - Allow selection of multiple rows
> > - Command-A to select all rows
> These both should be solved if we switch from `WI.DataGrid` to `WI.Table`. 
> We'd need to either add logic to `WI.Table` to support editing by default,
> or add custom logic to `WI.DOMStorageContentView` for editing.

These still haven't been addressed. Will split off another bug and relate.