Thanks to visit codestin.com
Credit goes to github.com

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

Prevent setting user agent string to default value on every rebuild #4618

Merged
merged 3 commits into from
Dec 17, 2021

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Dec 15, 2021

The webview_flutter_android plugin was setting the UserAgentString to the default value whenever it was rebuilt. This should only be done when it was rebuilt with a null value.

Fixes: flutter/flutter#94847

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.

@github-actions github-actions bot added p: webview_flutter Edits files for a webview_flutter plugin platform-android labels Dec 15, 2021
@bparrishMines bparrishMines changed the title dont update user agent string Prevent setting user agent string to default value on every rebuild Dec 15, 2021
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM with a test naming nit.

@@ -483,6 +483,31 @@ void main() {
});
});

testWidgets('update userAgentString', (WidgetTester tester) async {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test name seems wrong; it's testing not updating the user agent string.

@bparrishMines
Copy link
Contributor Author

The tree is green again despite submit-queue being red

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: webview_flutter Edits files for a webview_flutter plugin platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[webview_flutter_android] User agent string is reset after rebuild
2 participants