Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Flutter Inappwebview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
Flutter Inappwebview
Commits
0c71edf8
Commit
0c71edf8
authored
Jun 29, 2020
by
Lorenzo Pichilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flutter format
parent
eea69166
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
138 deletions
+116
-138
lib/src/headless_in_app_webview.dart
lib/src/headless_in_app_webview.dart
+21
-20
lib/src/in_app_browser.dart
lib/src/in_app_browser.dart
+0
-1
lib/src/in_app_webview.dart
lib/src/in_app_webview.dart
+21
-20
lib/src/in_app_webview_controller.dart
lib/src/in_app_webview_controller.dart
+37
-50
lib/src/types.dart
lib/src/types.dart
+19
-38
lib/src/webview.dart
lib/src/webview.dart
+18
-9
No files found.
lib/src/headless_in_app_webview.dart
View file @
0c71edf8
...
...
@@ -201,20 +201,16 @@ class HeadlessInAppWebView implements WebView {
CreateWindowRequest
onCreateWindowRequest
)
onCreateWindow
;
@override
final
void
Function
(
InAppWebViewController
controller
)
onCloseWindow
;
final
void
Function
(
InAppWebViewController
controller
)
onCloseWindow
;
@override
final
void
Function
(
InAppWebViewController
controller
)
onWindowFocus
;
final
void
Function
(
InAppWebViewController
controller
)
onWindowFocus
;
@override
final
void
Function
(
InAppWebViewController
controller
)
onWindowBlur
;
final
void
Function
(
InAppWebViewController
controller
)
onWindowBlur
;
@override
final
void
Function
(
InAppWebViewController
controller
)
androidOnRequestFocus
;
final
void
Function
(
InAppWebViewController
controller
)
androidOnRequestFocus
;
@override
final
void
Function
(
InAppWebViewController
controller
,
String
url
)
...
...
@@ -226,15 +222,18 @@ class HeadlessInAppWebView implements WebView {
@override
final
Future
<
JsAlertResponse
>
Function
(
InAppWebViewController
controller
,
JsAlertRequest
jsAlertRequest
)
onJsAlert
;
InAppWebViewController
controller
,
JsAlertRequest
jsAlertRequest
)
onJsAlert
;
@override
final
Future
<
JsConfirmResponse
>
Function
(
InAppWebViewController
controller
,
JsConfirmRequest
jsConfirmRequest
)
onJsConfirm
;
InAppWebViewController
controller
,
JsConfirmRequest
jsConfirmRequest
)
onJsConfirm
;
@override
final
Future
<
JsPromptResponse
>
Function
(
InAppWebViewController
controller
,
JsPromptRequest
jsPromptRequest
)
onJsPrompt
;
final
Future
<
JsPromptResponse
>
Function
(
InAppWebViewController
controller
,
JsPromptRequest
jsPromptRequest
)
onJsPrompt
;
@override
final
void
Function
(
InAppWebViewController
controller
,
String
url
,
int
code
,
...
...
@@ -355,15 +354,17 @@ class HeadlessInAppWebView implements WebView {
androidOnReceivedIcon
;
@override
final
void
Function
(
InAppWebViewController
controller
,
String
url
,
bool
precomposed
)
final
void
Function
(
InAppWebViewController
controller
,
String
url
,
bool
precomposed
)
androidOnReceivedTouchIconUrl
;
@override
final
Future
<
JsBeforeUnloadResponse
>
Function
(
InAppWebViewController
controller
,
JsBeforeUnloadRequest
jsBeforeUnloadRequest
)
androidOnJsBeforeUnload
;
InAppWebViewController
controller
,
JsBeforeUnloadRequest
jsBeforeUnloadRequest
)
androidOnJsBeforeUnload
;
@override
final
void
Function
(
InAppWebViewController
controller
,
LoginRequest
loginRequest
)
final
void
Function
(
InAppWebViewController
controller
,
LoginRequest
loginRequest
)
androidOnReceivedLoginRequest
;
}
lib/src/in_app_browser.dart
View file @
0c71edf8
...
...
@@ -567,7 +567,6 @@ class InAppBrowser {
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTitle(android.webkit.WebView,%20java.lang.String)
void
onTitleChanged
(
String
title
)
{}
///Event fired when the WebView notifies that a loading URL has been flagged by Safe Browsing.
///The default behavior is to show an interstitial to the user, with the reporting checkbox visible.
///
...
...
lib/src/in_app_webview.dart
View file @
0c71edf8
...
...
@@ -165,27 +165,24 @@ class InAppWebView extends StatefulWidget implements WebView {
CreateWindowRequest
onCreateWindowRequest
)
onCreateWindow
;
@override
final
void
Function
(
InAppWebViewController
controller
)
onCloseWindow
;
final
void
Function
(
InAppWebViewController
controller
)
onCloseWindow
;
@override
final
void
Function
(
InAppWebViewController
controller
)
onWindowFocus
;
final
void
Function
(
InAppWebViewController
controller
)
onWindowFocus
;
@override
final
void
Function
(
InAppWebViewController
controller
)
onWindowBlur
;
final
void
Function
(
InAppWebViewController
controller
)
onWindowBlur
;
@override
final
void
Function
(
InAppWebViewController
controller
)
androidOnRequestFocus
;
final
void
Function
(
InAppWebViewController
controller
)
androidOnRequestFocus
;
@override
final
void
Function
(
InAppWebViewController
controller
,
Uint8List
icon
)
androidOnReceivedIcon
;
@override
final
void
Function
(
InAppWebViewController
controller
,
String
url
,
bool
precomposed
)
final
void
Function
(
InAppWebViewController
controller
,
String
url
,
bool
precomposed
)
androidOnReceivedTouchIconUrl
;
@override
...
...
@@ -198,15 +195,18 @@ class InAppWebView extends StatefulWidget implements WebView {
@override
final
Future
<
JsAlertResponse
>
Function
(
InAppWebViewController
controller
,
JsAlertRequest
jsAlertRequest
)
onJsAlert
;
InAppWebViewController
controller
,
JsAlertRequest
jsAlertRequest
)
onJsAlert
;
@override
final
Future
<
JsConfirmResponse
>
Function
(
InAppWebViewController
controller
,
JsConfirmRequest
jsConfirmRequest
)
onJsConfirm
;
InAppWebViewController
controller
,
JsConfirmRequest
jsConfirmRequest
)
onJsConfirm
;
@override
final
Future
<
JsPromptResponse
>
Function
(
InAppWebViewController
controller
,
JsPromptRequest
jsPromptRequest
)
onJsPrompt
;
final
Future
<
JsPromptResponse
>
Function
(
InAppWebViewController
controller
,
JsPromptRequest
jsPromptRequest
)
onJsPrompt
;
@override
final
void
Function
(
InAppWebViewController
controller
,
String
url
,
int
code
,
...
...
@@ -324,11 +324,12 @@ class InAppWebView extends StatefulWidget implements WebView {
@override
final
Future
<
JsBeforeUnloadResponse
>
Function
(
InAppWebViewController
controller
,
JsBeforeUnloadRequest
jsBeforeUnloadRequest
)
androidOnJsBeforeUnload
;
InAppWebViewController
controller
,
JsBeforeUnloadRequest
jsBeforeUnloadRequest
)
androidOnJsBeforeUnload
;
@override
final
void
Function
(
InAppWebViewController
controller
,
LoginRequest
loginRequest
)
final
void
Function
(
InAppWebViewController
controller
,
LoginRequest
loginRequest
)
androidOnReceivedLoginRequest
;
}
...
...
lib/src/in_app_webview_controller.dart
View file @
0c71edf8
...
...
@@ -228,19 +228,21 @@ class InAppWebViewController {
if
(
_webview
!=
null
&&
_webview
.
onCreateWindow
!=
null
)
webView
=
await
_webview
.
onCreateWindow
(
this
,
createWindowRequest
);
else
if
(
_inAppBrowser
!=
null
)
{
inAppBrowserWindow
=
await
_inAppBrowser
.
onCreateWindow
(
createWindowRequest
);
inAppBrowserWindow
=
await
_inAppBrowser
.
onCreateWindow
(
createWindowRequest
);
assert
(
inAppBrowserWindow
is
InAppBrowser
||
inAppBrowserWindow
is
HeadlessInAppWebView
,
"InAppBrowser.onCreateWindow should return an
\"
InAppBrowser
\"
instance or a
\"
HeadlessInAppWebView
\"
instance."
);
inAppBrowserWindow
is
InAppBrowser
||
inAppBrowserWindow
is
HeadlessInAppWebView
,
"InAppBrowser.onCreateWindow should return an
\"
InAppBrowser
\"
instance or a
\"
HeadlessInAppWebView
\"
instance."
);
}
int
webViewWindowId
;
if
(
webView
!=
null
)
{
webViewWindowId
=
webView
.
windowId
;
assert
(
webViewWindowId
!=
null
,
"If you are returning a WebView, then WebView.windowId should be not null. To set the "
+
assert
(
webViewWindowId
!=
null
,
"If you are returning a WebView, then WebView.windowId should be not null. To set the "
+
"WebView.windowId property, you should use the CreateWindowRequest.windowId property."
);
if
(
webView
is
HeadlessInAppWebView
)
{
webView
.
run
();
...
...
@@ -248,15 +250,16 @@ class InAppWebViewController {
}
else
if
(
inAppBrowserWindow
!=
null
)
{
if
(
inAppBrowserWindow
is
InAppBrowser
)
{
webViewWindowId
=
inAppBrowserWindow
.
windowId
;
assert
(
webViewWindowId
!=
null
,
"If you are returning an InAppBrowser, then InAppBrowser.windowId should be not null. To set the "
+
assert
(
webViewWindowId
!=
null
,
"If you are returning an InAppBrowser, then InAppBrowser.windowId should be not null. To set the "
+
"InAppBrowser.windowId property, you should use the CreateWindowRequest.windowId property."
);
inAppBrowserWindow
.
openUrl
(
url:
"about:blank"
);
}
else
if
(
inAppBrowserWindow
is
HeadlessInAppWebView
)
{
}
else
if
(
inAppBrowserWindow
is
HeadlessInAppWebView
)
{
webViewWindowId
=
inAppBrowserWindow
.
windowId
;
assert
(
webViewWindowId
!=
null
,
"If you are returning a HeadlessInAppWebView, then HeadlessInAppWebView.windowId should be not null. To set the "
+
assert
(
webViewWindowId
!=
null
,
"If you are returning a HeadlessInAppWebView, then HeadlessInAppWebView.windowId should be not null. To set the "
+
"HeadlessInAppWebView.windowId property, you should use the CreateWindowRequest.windowId property."
);
inAppBrowserWindow
.
run
();
}
...
...
@@ -266,15 +269,13 @@ class InAppWebViewController {
case
"onCloseWindow"
:
if
(
_webview
!=
null
&&
_webview
.
onCloseWindow
!=
null
)
_webview
.
onCloseWindow
(
this
);
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
onCloseWindow
();
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
onCloseWindow
();
break
;
case
"onTitleChanged"
:
String
title
=
call
.
arguments
[
"title"
];
if
(
_webview
!=
null
&&
_webview
.
onTitleChanged
!=
null
)
_webview
.
onTitleChanged
(
this
,
title
);
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
onTitleChanged
(
title
);
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
onTitleChanged
(
title
);
break
;
case
"onGeolocationPermissionsShowPrompt"
:
String
origin
=
call
.
arguments
[
"origin"
];
...
...
@@ -369,8 +370,7 @@ class InAppWebViewController {
case
"onRequestFocus"
:
if
(
_webview
!=
null
&&
_webview
.
androidOnRequestFocus
!=
null
)
_webview
.
androidOnRequestFocus
(
this
);
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
androidOnRequestFocus
();
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
androidOnRequestFocus
();
break
;
case
"onReceivedIcon"
:
Uint8List
icon
=
Uint8List
.
fromList
(
call
.
arguments
[
"icon"
].
cast
<
int
>());
...
...
@@ -394,10 +394,7 @@ class InAppWebViewController {
bool
iosIsMainFrame
=
call
.
arguments
[
"iosIsMainFrame"
];
JsAlertRequest
jsAlertRequest
=
JsAlertRequest
(
url:
url
,
message:
message
,
iosIsMainFrame:
iosIsMainFrame
);
url:
url
,
message:
message
,
iosIsMainFrame:
iosIsMainFrame
);
if
(
_webview
!=
null
&&
_webview
.
onJsAlert
!=
null
)
return
(
await
_webview
.
onJsAlert
(
this
,
jsAlertRequest
))?.
toMap
();
...
...
@@ -410,10 +407,7 @@ class InAppWebViewController {
bool
iosIsMainFrame
=
call
.
arguments
[
"iosIsMainFrame"
];
JsConfirmRequest
jsConfirmRequest
=
JsConfirmRequest
(
url:
url
,
message:
message
,
iosIsMainFrame:
iosIsMainFrame
);
url:
url
,
message:
message
,
iosIsMainFrame:
iosIsMainFrame
);
if
(
_webview
!=
null
&&
_webview
.
onJsConfirm
!=
null
)
return
(
await
_webview
.
onJsConfirm
(
this
,
jsConfirmRequest
))?.
toMap
();
...
...
@@ -430,15 +424,12 @@ class InAppWebViewController {
url:
url
,
message:
message
,
defaultValue:
defaultValue
,
iosIsMainFrame:
iosIsMainFrame
);
iosIsMainFrame:
iosIsMainFrame
);
if
(
_webview
!=
null
&&
_webview
.
onJsPrompt
!=
null
)
return
(
await
_webview
.
onJsPrompt
(
this
,
jsPromptRequest
))
?.
toMap
();
return
(
await
_webview
.
onJsPrompt
(
this
,
jsPromptRequest
))?.
toMap
();
else
if
(
_inAppBrowser
!=
null
)
return
(
await
_inAppBrowser
.
onJsPrompt
(
jsPromptRequest
))
?.
toMap
();
return
(
await
_inAppBrowser
.
onJsPrompt
(
jsPromptRequest
))?.
toMap
();
break
;
case
"onJsBeforeUnload"
:
String
url
=
call
.
arguments
[
"url"
];
...
...
@@ -446,17 +437,18 @@ class InAppWebViewController {
bool
iosIsMainFrame
=
call
.
arguments
[
"iosIsMainFrame"
];
JsBeforeUnloadRequest
jsBeforeUnloadRequest
=
JsBeforeUnloadRequest
(
url:
url
,
message:
message
,
iosIsMainFrame:
iosIsMainFrame
);
url:
url
,
message:
message
,
iosIsMainFrame:
iosIsMainFrame
);
print
(
jsBeforeUnloadRequest
);
if
(
_webview
!=
null
&&
_webview
.
androidOnJsBeforeUnload
!=
null
)
return
(
await
_webview
.
androidOnJsBeforeUnload
(
this
,
jsBeforeUnloadRequest
))?.
toMap
();
return
(
await
_webview
.
androidOnJsBeforeUnload
(
this
,
jsBeforeUnloadRequest
))
?.
toMap
();
else
if
(
_inAppBrowser
!=
null
)
return
(
await
_inAppBrowser
.
androidOnJsBeforeUnload
(
jsBeforeUnloadRequest
))?.
toMap
();
return
(
await
_inAppBrowser
.
androidOnJsBeforeUnload
(
jsBeforeUnloadRequest
))
?.
toMap
();
break
;
case
"onSafeBrowsingHit"
:
String
url
=
call
.
arguments
[
"url"
];
...
...
@@ -475,11 +467,8 @@ class InAppWebViewController {
String
account
=
call
.
arguments
[
"account"
];
String
args
=
call
.
arguments
[
"args"
];
LoginRequest
loginRequest
=
LoginRequest
(
realm:
realm
,
account:
account
,
args:
args
);
LoginRequest
loginRequest
=
LoginRequest
(
realm:
realm
,
account:
account
,
args:
args
);
if
(
_webview
!=
null
&&
_webview
.
androidOnReceivedLoginRequest
!=
null
)
_webview
.
androidOnReceivedLoginRequest
(
this
,
loginRequest
);
...
...
@@ -942,14 +931,12 @@ class InAppWebViewController {
case
"onWindowFocus"
:
if
(
_webview
!=
null
&&
_webview
.
onWindowFocus
!=
null
)
_webview
.
onWindowFocus
(
this
);
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
onWindowFocus
();
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
onWindowFocus
();
return
null
;
case
"onWindowBlur"
:
if
(
_webview
!=
null
&&
_webview
.
onWindowBlur
!=
null
)
_webview
.
onWindowBlur
(
this
);
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
onWindowBlur
();
else
if
(
_inAppBrowser
!=
null
)
_inAppBrowser
.
onWindowBlur
();
return
null
;
}
...
...
lib/src/types.dart
View file @
0c71edf8
...
...
@@ -450,11 +450,7 @@ class JsAlertRequest {
///Indicates whether the request was made for the main frame. Available only on iOS.
bool
iosIsMainFrame
;
JsAlertRequest
({
this
.
url
,
this
.
message
,
this
.
iosIsMainFrame
});
JsAlertRequest
({
this
.
url
,
this
.
message
,
this
.
iosIsMainFrame
});
Map
<
String
,
dynamic
>
toMap
()
{
return
{
"url"
:
url
,
"message"
:
message
,
"iosIsMainFrame"
:
iosIsMainFrame
};
...
...
@@ -536,11 +532,7 @@ class JsConfirmRequest {
///Indicates whether the request was made for the main frame. Available only on iOS.
bool
iosIsMainFrame
;
JsConfirmRequest
({
this
.
url
,
this
.
message
,
this
.
iosIsMainFrame
});
JsConfirmRequest
({
this
.
url
,
this
.
message
,
this
.
iosIsMainFrame
});
Map
<
String
,
dynamic
>
toMap
()
{
return
{
"url"
:
url
,
"message"
:
message
,
"iosIsMainFrame"
:
iosIsMainFrame
};
...
...
@@ -631,15 +623,16 @@ class JsPromptRequest {
///Indicates whether the request was made for the main frame. Available only on iOS.
bool
iosIsMainFrame
;
JsPromptRequest
({
this
.
url
,
this
.
message
,
this
.
defaultValue
,
this
.
iosIsMainFrame
});
JsPromptRequest
(
{
this
.
url
,
this
.
message
,
this
.
defaultValue
,
this
.
iosIsMainFrame
});
Map
<
String
,
dynamic
>
toMap
()
{
return
{
"url"
:
url
,
"message"
:
message
,
"defaultValue"
:
defaultValue
,
"iosIsMainFrame"
:
iosIsMainFrame
};
return
{
"url"
:
url
,
"message"
:
message
,
"defaultValue"
:
defaultValue
,
"iosIsMainFrame"
:
iosIsMainFrame
};
}
Map
<
String
,
dynamic
>
toJson
()
{
...
...
@@ -734,11 +727,7 @@ class JsBeforeUnloadRequest {
///Indicates whether the request was made for the main frame. Available only on iOS.
bool
iosIsMainFrame
;
JsBeforeUnloadRequest
({
this
.
url
,
this
.
message
,
this
.
iosIsMainFrame
});
JsBeforeUnloadRequest
({
this
.
url
,
this
.
message
,
this
.
iosIsMainFrame
});
Map
<
String
,
dynamic
>
toMap
()
{
return
{
"url"
:
url
,
"message"
:
message
,
"iosIsMainFrame"
:
iosIsMainFrame
};
...
...
@@ -4376,18 +4365,10 @@ class LoginRequest {
///Authenticator specific arguments used to log in the user.
String
args
;
LoginRequest
({
this
.
realm
,
this
.
account
,
this
.
args
});
LoginRequest
({
this
.
realm
,
this
.
account
,
this
.
args
});
Map
<
String
,
dynamic
>
toMap
()
{
return
{
"realm"
:
realm
,
"account"
:
account
,
"args"
:
args
};
return
{
"realm"
:
realm
,
"account"
:
account
,
"args"
:
args
};
}
Map
<
String
,
dynamic
>
toJson
()
{
...
...
lib/src/webview.dart
View file @
0c71edf8
...
...
@@ -187,7 +187,8 @@ abstract class WebView {
///
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkuidelegate/1537406-webview
final
Future
<
JsAlertResponse
>
Function
(
InAppWebViewController
controller
,
JsAlertRequest
jsAlertRequest
)
onJsAlert
;
InAppWebViewController
controller
,
JsAlertRequest
jsAlertRequest
)
onJsAlert
;
///Event fired when javascript calls the `confirm()` method to display a confirm dialog.
///If [JsConfirmResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
...
...
@@ -198,7 +199,8 @@ abstract class WebView {
///
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview
final
Future
<
JsConfirmResponse
>
Function
(
InAppWebViewController
controller
,
JsConfirmRequest
jsConfirmRequest
)
onJsConfirm
;
InAppWebViewController
controller
,
JsConfirmRequest
jsConfirmRequest
)
onJsConfirm
;
///Event fired when javascript calls the `prompt()` method to display a prompt dialog.
///If [JsPromptResponse.handledByClient] is `true`, the webview will assume that the client will handle the dialog.
...
...
@@ -208,8 +210,9 @@ abstract class WebView {
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebChromeClient#onJsPrompt(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20android.webkit.JsPromptResult)
///
///**Official iOS API**: https://developer.apple.com/documentation/webkit/wkuidelegate/1538086-webview
final
Future
<
JsPromptResponse
>
Function
(
InAppWebViewController
controller
,
JsPromptRequest
jsPromptRequest
)
onJsPrompt
;
final
Future
<
JsPromptResponse
>
Function
(
InAppWebViewController
controller
,
JsPromptRequest
jsPromptRequest
)
onJsPrompt
;
///Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
///
...
...
@@ -539,7 +542,8 @@ abstract class WebView {
///**NOTE**: available only on Android.
///
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedIcon(android.webkit.WebView,%20android.graphics.Bitmap)
final
void
Function
(
InAppWebViewController
controller
,
Uint8List
icon
)
androidOnReceivedIcon
;
final
void
Function
(
InAppWebViewController
controller
,
Uint8List
icon
)
androidOnReceivedIcon
;
///Event fired when there is an url for an apple-touch-icon.
///
...
...
@@ -550,7 +554,9 @@ abstract class WebView {
///**NOTE**: available only on Android.
///
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTouchIconUrl(android.webkit.WebView,%20java.lang.String,%20boolean)
final
void
Function
(
InAppWebViewController
controller
,
String
url
,
bool
precomposed
)
androidOnReceivedTouchIconUrl
;
final
void
Function
(
InAppWebViewController
controller
,
String
url
,
bool
precomposed
)
androidOnReceivedTouchIconUrl
;
///Event fired when the client should display a dialog to confirm navigation away from the current page.
///This is the result of the `onbeforeunload` javascript event.
...
...
@@ -566,7 +572,8 @@ abstract class WebView {
///
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebChromeClient#onJsBeforeUnload(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)
final
Future
<
JsBeforeUnloadResponse
>
Function
(
InAppWebViewController
controller
,
JsBeforeUnloadRequest
jsBeforeUnloadRequest
)
androidOnJsBeforeUnload
;
InAppWebViewController
controller
,
JsBeforeUnloadRequest
jsBeforeUnloadRequest
)
androidOnJsBeforeUnload
;
///Event fired when a request to automatically log in the user has been processed.
///
...
...
@@ -575,7 +582,9 @@ abstract class WebView {
///**NOTE**: available only on Android.
///
///**Official Android API**: https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedLoginRequest(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20java.lang.String)
final
void
Function
(
InAppWebViewController
controller
,
LoginRequest
loginRequest
)
androidOnReceivedLoginRequest
;
final
void
Function
(
InAppWebViewController
controller
,
LoginRequest
loginRequest
)
androidOnReceivedLoginRequest
;
///Invoked when the web view's web content process is terminated.
///
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment