-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter] get/set a custom User Agent #1920
Changes from 10 commits
953e220
9478588
45e915d
ae81a98
de27c90
cbcc808
4141cf2
d54e0bc
86d44ca
7959989
7b26a41
7fed032
c5cc6a7
c99c8f2
c931307
7976151
4c0d2f3
de4d1df
5be86ef
5887b33
bf8b74c
ebe699d
ee693fd
641537b
db3cfb9
974c16e
c13245a
3282117
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,6 +103,11 @@ class MethodChannelWebViewPlatform implements WebViewPlatformController { | |
| 'removeJavascriptChannels', javascriptChannelNames.toList()); | ||
| } | ||
|
|
||
| @override | ||
| Future<String> getUserAgent() { | ||
| return _channel.invokeMethod('getUserAgent'); | ||
| } | ||
|
|
||
| /// Method channel mplementation for [WebViewPlatform.clearCookies]. | ||
| static Future<bool> clearCookies() { | ||
| return _cookieManagerChannel | ||
|
|
@@ -122,6 +127,7 @@ class MethodChannelWebViewPlatform implements WebViewPlatformController { | |
| _addIfNonNull('jsMode', settings.javascriptMode?.index); | ||
| _addIfNonNull('hasNavigationDelegate', settings.hasNavigationDelegate); | ||
| _addIfNonNull('debuggingEnabled', settings.debuggingEnabled); | ||
| _addIfNonNull('userAgent', settings.userAgent); | ||
|
||
| return map; | ||
| } | ||
|
|
||
|
|
@@ -135,6 +141,7 @@ class MethodChannelWebViewPlatform implements WebViewPlatformController { | |
| 'initialUrl': creationParams.initialUrl, | ||
| 'settings': _webSettingsToMap(creationParams.webSettings), | ||
| 'javascriptChannelNames': creationParams.javascriptChannelNames.toList(), | ||
| 'userAgent': creationParams.userAgent, | ||
| }; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.