Skip to content
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

feat: implement storage.getCookies and storage.setCookie #1593

Merged
merged 21 commits into from
Jan 12, 2024

Conversation

sadym-chromium
Copy link
Collaborator

@sadym-chromium sadym-chromium commented Nov 24, 2023

Implement storage commands:

  • storage.getCookies
  • storage.setCookie

@sadym-chromium sadym-chromium requested a review from OrKoN November 24, 2023 14:17
@sadym-chromium sadym-chromium marked this pull request as ready for review November 24, 2023 14:17
tests/test_helpers.py Outdated Show resolved Hide resolved
.github/workflows/e2e.yml Outdated Show resolved Hide resolved
@sadym-chromium sadym-chromium marked this pull request as draft November 24, 2023 15:42
@sadym-chromium sadym-chromium marked this pull request as ready for review November 24, 2023 15:58
sadym-chromium added a commit that referenced this pull request Nov 24, 2023
Sometimes it is required to have types from not-yet merged branch of
spec (#1593). This
PR provides a way to specify a branch of a specific commit to update
types from.

---------

Co-authored-by: Maksim Sadym <sadym@google.com>
@sadym-chromium sadym-chromium changed the title feat: command storage.getCookies [BLOCKED] feat: command storage.getCookies Nov 27, 2023
@sadym-chromium sadym-chromium added the DO NOT MERGE Don't merge the marked PR label Nov 27, 2023
@sadym-chromium sadym-chromium marked this pull request as draft November 27, 2023 08:44
@sadym-chromium sadym-chromium changed the base branch from main to sadym/no-e2e-rerun November 27, 2023 08:44
Base automatically changed from sadym/no-e2e-rerun to main November 27, 2023 08:51
@sadym-chromium sadym-chromium force-pushed the sadym/cookies branch 6 times, most recently from 55421d3 to 5c5cc68 Compare December 1, 2023 12:29
@sadym-chromium sadym-chromium force-pushed the sadym/cookies branch 2 times, most recently from d5df1bf to e6cf54d Compare December 4, 2023 10:08
@sadym-chromium sadym-chromium changed the title [BLOCKED] feat: command storage.getCookies [BLOCKED] feat: command storage.cookies Dec 15, 2023
@jrandolf-2
Copy link
Contributor

lgtm!

@jrandolf-2 jrandolf-2 self-requested a review January 12, 2024 06:44
@sadym-chromium sadym-chromium enabled auto-merge (squash) January 12, 2024 08:13
@sadym-chromium sadym-chromium merged commit 2b08660 into main Jan 12, 2024
33 checks passed
@sadym-chromium sadym-chromium deleted the sadym/cookies branch January 12, 2024 08:22
Copy link
Collaborator

@Lightning00Blade Lightning00Blade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM + some minor comments.

@@ -0,0 +1,283 @@
/*
* Copyright 2023 Google LLC.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Copyright 2023 Google LLC.
* Copyright 2024 Google LLC.

"params": {
"expression": f"document.body.innerHTML = '{html_content}'",
"functionDeclaration": "(html_content) => { document.body.innerHTML = html_content }",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's consider using the script from Puppeteer I think it may be less falky.
As the DOM should be stable all written by the time the command returns.

      document.open();
      document.write(html);
      document.close();

const browsingContextId: string = descriptor.context;
const browsingContext =
this.#browsingContextStorage.getContext(browsingContextId);
const url = NetworkProcessor.parseUrlString(browsingContext?.url ?? '');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This should not live on the NetworkProcessor but extracted into helper.

sadym-chromium pushed a commit that referenced this pull request Jan 18, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.5.4](chromium-bidi-v0.5.3...chromium-bidi-v0.5.4)
(2024-01-17)


### Features

* implement `Input.setFiles`
([#1705](#1705))
([50d1921](50d1921))
* implement `storage.getCookies` and `storage.setCookie`
([#1593](#1593))
([2b08660](2b08660))
* implement permissions
([#1645](#1645))
([29c7b0b](29c7b0b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants