inspector: report an error when DOM storage is unavailable - #65897
Closed
lazerg wants to merge 1 commit into
Closed
Conversation
Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
Collaborator
|
Review requested:
|
Contributor
|
Caution AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DOMStorage.getDOMStorageItemsfalls back to reading the liveStorageobject when its cached map is empty, but whengetWebStorage()cannot produce one it skips the fallback and still answers withSuccessand an emptyentriesarray.getWebStorage()returns nothing wheneverglobalThis.localStorageis missing or is not an object, which is the case for any process started without--localstorage-file, so a frontend cannot tell an empty store from a store it has no access to.It now returns a
Could not read DOM storage itemsprotocol error in that case, alongside theDOMStorage domain is not enablederror the same function already produces. This does change what a DevTools frontend sees for a process with no--localstorage-file: the localStorage panel gets an error rather than an empty table. The cached map registered throughDOMStorage.registerStoragestill short-circuits ahead of the check, so registering an empty map reads as an empty store.Tests:
test/parallel/test-inspector-dom-storage-unavailable.jspostsDOMStorage.getDOMStorageItemswithout--localstorage-file; it resolves with an empty result before this change and rejects withERR_INSPECTOR_COMMANDafter.Fixes: #65895