WebkitWebChromeClient
WebkitFileChooserParams
Functions:
- Initialize (AndroidWebkitFileChooserParams As Object) As String
Initializes the instance from adroid.webkit.WebChromeClient.FileChooserParams from inline Java.
Added in API level 21.
- ParseResult (ResultCode As Int, Data As Intent) As Object
Parse the result returned by the file picker activity.
Added in API level 21.
- IsInitialized As Boolean
Tests whether the object has been initialized.
Properties:
- AcceptTypes As String() [read only]
Returns an array of acceptable MIME types.
Added in API level 21.
- FilenameHint As String [read only]
The file name of a default selection if specified, or null.
Added in API level 21.
- Intent As Intent [read only]
Creates an intent that would start a file picker for file selection.
Added in API level 21.
- IsCaptureEnabled As Boolean [read only]
Returns preference for a live media captured value (e.g. Camera, Microphone).
Added in API level 21.
- Mode As Int [read only]
Returns file chooser mode.
Added in API level 21.
- ModeAsString As String [read only]
Returns string value for file chooser mode.
Added in API level 21.
- Title As String [read only]
Returns the title to use for this file selector.
Added in API level 21.
WebkitWebChromeClient
Events:
- ConsoleMessage (ConsoleMessage1 As WebkitConsoleMessage) As Boolean 'Works from API level 8 and above. WebkitConsoleMessage library required.
- CreateChildWindow (IsDialog As Boolean, IsUserGesture As Boolean) As WebView 'Works from API level 1 and above. SupportMultipleWindows option must be enabled.
- FileChooserInitialized (FilePathCallback As Object, FileChooserParams As WebkitFileChooserParams) 'Works from API level 21 and above.
- JsAlert (JsProperties As WebkitJsProperties, JsResult As WebkitJsResult) As Boolean 'Works from API level 1 and above. WebkitJsResultAndJsPromptResult library required.
- JsBeforeUnload (JsProperties As WebkitJsProperties, JsResult As WebkitJsResult) As Boolean 'Works from API level 1 and above. WebkitJsResultAndJsPromptResult library required.
- JsConfirm (JsProperties As WebkitJsProperties, JsResult As WebkitJsResult) As Boolean 'Works from API level 1 and above. WebkitJsResultAndJsPromptResult library required.
- JsPrompt (JsProperties As WebkitJsProperties, JsPromptResult As WebkitJsPromptResult) As Boolean 'Works from API level 1 and above. WebkitJsResultAndJsPromptResult library required.
- PageLoadingProgressChanged (Progress As Int) 'Works from API level 1 and above.
- PermissionRequest (RequestedPermission As String) 'Works from API level 21 and above.
- ReceivedIcon (Icon As Bitmap) 'Works from API level 1 and above.
- ReceivedTitle (Title As String) 'Works from API level 1 and above.
Functions:
- AllowFullScreenVideo (Allowed As Boolean, ForceLandscape As Boolean) As String
This method enables or disables WebView's ability to play online video in full screen.
Allowed As Boolean - Allowed (True) or Not Allowed (False).
ForceLandscape As Boolean - Force full screen video to play in landscape screen orientation.
IMPORTANT: SoftOrientation library is required or other mathods which will prevent the Activity to redraw on the orientation change!!!
SoftOrientation Url: https://www.b4x.com/android/forum/threads/softorientation-library-for-activitiy-and-b4xpages-based-projects.143896/#post-912287
- FileChooserStart (FilePathCallback As Object, FileChooserParams1 As WebkitFileChooserParams, ForceIsCaptureEnabled As Boolean) As String
You can use this method to run FileChooser to upload a file. It is important that you use this method in the FileChooserInitialized event.
FilePathCallback and FileChooserParams1 are initialized by Event.
ForceIsCaptureEnabled As Boolean - True: Use resources such as camera, microphone, etc. by force if the required file format is appropriate. False: Use a predefined value assigned to FileChooserParams.
WebkitMimeTypeMap library iz required!
Added in API level 21. It will not work for lower API's.
- GrantPermission (Granted As Boolean) As String
Use to grant or deny permissions which is required by loaded WebSite (Camera, Microphone, Geolocation, Externall Storage...).
Event PermissionRequest (RequestedPermission As String) will be fired when permission is required.
Use RuntimePermissions library to handle permission request.
Example:
Sub [WebkitWebChromeClient EventName]_PermissionRequest (RequestedPermission As String)
Dim rp As RuntimePermissions
rp.CheckAndRequest(RequestedPermission)
Wait For Activity_PermissionResult (Permission As String, result As Boolean)
[WebkitWebChromeClient Variable].GrantPermission(result)
End Sub
- Initialize (CallBack As Object, EventName As String, WebView1 As WebView, Enabled As Boolean) As String
Initializes the new instance of custom android.webkit.WebChromeClient as WebkitWebChromClient.
WebView1 As WebView - Pass WebView into which the WebkitWebChromeClient will be integrated, or pass Null if you just want to initialize the WebkitWebChromeClient that you will integrate manually by calling ToObject method. If you pass Null, Enabled property will have no effect and will always be False.
Enabled as Boolean - Pass True to start WebkitWebChromeClient immediately or pass False if you want to start it later. You can change Enabled state throught WebkitWebChromeClient.Enabled property.
- ToObject As Object
Convert WebkitWebChromeClient to android.webkit.WebChromeClient which can be used in inline Java code.
- IsInitialized As Boolean
Tests whether the object has been initialized.
Properties:
- Enabled As Boolean
Gets or sets WebkitWebChromeClient state.
True - Start WebkitWebChromeClient.
False - Stop WebkitWebChromeClient.
- WebViewsChildrenViews As List [read only]
Gets the List of children Webviews which is generated by main Webview. SupportMultipleWindows must be enabled, or will always be empty list.