Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[webview_flutter] Add setCookie to CookieManager and support initial cookies in creation params. #4561

Merged
merged 41 commits into from
Dec 7, 2021

Conversation

BeMacized
Copy link
Contributor

@BeMacized BeMacized commented Dec 1, 2021

This PR adds a function for setting cookies to the CookieManager, as well support for setting initial cookies through the CreationParams object.

As this PR depends on, and contains the changes of, updates made to the platform interface in #4555, as well as the platform specific implementations in #4556 and #4557, this PR will remain in draft mode until those changes have been merged and published.

Fixes flutter/flutter#27597

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Drive-by comment nit.


static CookieManager? _instance;

/// Clears all cookies for all [WebView] instances.
///
/// This is a no op on iOS version smaller than 9.
/// This is a no op on iOS versions below 9.
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't support versions below 9 any more, so you can just remove this.

@stuartmorgan
Copy link
Contributor

Dependencies are published; this is ready to be finalized.

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

Just minor things; looks good overall.

packages/webview_flutter/webview_flutter/CHANGELOG.md Outdated Show resolved Hide resolved
packages/webview_flutter/webview_flutter/pubspec.yaml Outdated Show resolved Hide resolved
@BeMacized BeMacized marked this pull request as ready for review December 7, 2021 20:26
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM

@BeMacized BeMacized added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Dec 7, 2021
@stuartmorgan
Copy link
Contributor

submit-queue is incorrectly reporting red; overriding.

@stuartmorgan stuartmorgan merged commit 4fdf85c into flutter:master Dec 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 7, 2021
amantoux pushed a commit to amantoux/plugins that referenced this pull request Dec 11, 2021
…cookies in creation params. (flutter#4561)

This PR adds a function for setting cookies to the CookieManager, as well support for setting initial cookies through the `CreationParams` object.

Fixes flutter/flutter#27597
KyleFin pushed a commit to KyleFin/plugins that referenced this pull request Dec 21, 2021
…cookies in creation params. (flutter#4561)

This PR adds a function for setting cookies to the CookieManager, as well support for setting initial cookies through the `CreationParams` object.

Fixes flutter/flutter#27597
@ismanong
Copy link

ismanong commented Aug 12, 2022

@BeMacized
Cookie implementations should not use UrlEncode encoding by default, which is inconsistent with browser behavior (do nothing, just key-value write), otherwise, it may lead to some possible business problems.

@stuartmorgan
Copy link
Contributor

This PR was landed last year; it can't be changed. If you have an issue to report, please use the issue tracker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes p: webview_flutter Edits files for a webview_flutter plugin waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WebView] Provide a way to set cookies
3 participants