Skip to content

fix: Storage.{get|set|clear}Cookies via CDP not working #41718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Mar 27, 2024

Description of Change

Closes #41703.

Addresses an issue where calling Storage.{get|set|clear}Cookies via the Chrome Devtools protocol would return the following error:

Browser context management is not supported.

This happened as a result of this logic for Storage handling which relies on a browser context being available via DevToolsManagerDelegate::GetDefaultBrowserContext(). Chrome's subclasses of DevToolsManagerDelegate override this to return a valid BrowserContext, but ours did not until this PR and so it would always be nullptr.

We can address this by returning the default BrowserContext in our subclass. This is modeled after the approach taken by ShellDevToolsManagerDelegate::GetDefaultBrowserContext().

cc @mxschmitt

Checklist

Release Notes

Notes: Fixed usage of Storage.{get|set|clear}Cookies via the Chrome DevTools Protocol.

Sorry, something went wrong.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/28-x-y PR should also be added to the "28-x-y" branch. target/29-x-y PR should also be added to the "29-x-y" branch. target/30-x-y PR should also be added to the "30-x-y" branch. labels Mar 27, 2024
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Mar 27, 2024
@codebytere codebytere force-pushed the enable-browser-context-mgmt branch from 3ef2115 to d74cde7 Compare March 27, 2024 19:28
@codebytere codebytere force-pushed the enable-browser-context-mgmt branch from d74cde7 to a5ee30e Compare March 27, 2024 19:28
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 28, 2024
@nornagon
Copy link
Contributor

Test failures are flake; merging.

@nornagon nornagon merged commit 0bf53a3 into main Mar 28, 2024
15 of 17 checks passed
@nornagon nornagon deleted the enable-browser-context-mgmt branch March 28, 2024 23:09
@release-clerk
Copy link

release-clerk bot commented Mar 28, 2024

Release Notes Persisted

Fixed usage of Storage.{get|set|clear}Cookies via the Chrome DevTools Protocol.

@trop
Copy link
Contributor

trop bot commented Mar 28, 2024

I have automatically backported this PR to "28-x-y", please check out #41738

@trop trop bot added in-flight/28-x-y and removed target/28-x-y PR should also be added to the "28-x-y" branch. labels Mar 28, 2024
@trop
Copy link
Contributor

trop bot commented Mar 28, 2024

I have automatically backported this PR to "29-x-y", please check out #41739

@trop
Copy link
Contributor

trop bot commented Mar 28, 2024

I have automatically backported this PR to "30-x-y", please check out #41740

@trop trop bot added in-flight/29-x-y in-flight/30-x-y merged/30-x-y PR was merged to the "30-x-y" branch. merged/29-x-y PR was merged to the "29-x-y" branch. and removed target/29-x-y PR should also be added to the "29-x-y" branch. target/30-x-y PR should also be added to the "30-x-y" branch. in-flight/30-x-y in-flight/29-x-y labels Mar 28, 2024
@trop trop bot added merged/28-x-y PR was merged to the "28-x-y" branch. and removed in-flight/28-x-y labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/28-x-y PR was merged to the "28-x-y" branch. merged/29-x-y PR was merged to the "29-x-y" branch. merged/30-x-y PR was merged to the "30-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Storage.GetCookies/SetCookies/ClearCookies CDP methods are not working
3 participants