CustomWebView : An extended form of Web Viewer

I am making admin app where I need google sign in when app is installed for the first time

1 Like

Google does it automatically.

1 Like

But now first time when you install the app and use webview

1 Like

I have a little question ā€¦
I am using your marvellous extension to load offline HTML pages that contains java script and it works fine and perfectā€¦

But the pages contains checkboxes that have a control on the HTML ā€¦
My question is ā€¦ how to use kodular checkbox component to control every time the html is loaded ā€¦
If kodular checkbox is checked, the one in the html will be checked too and the same for uncheck

Would you help me?

1 Like

I think you can use JavaScript.

2 Likes

Is it a javascript component ?

Is there any thing in the community shows how to do something like that because I searched and didnā€™t find anything matching

1 Like

Hi,

I use WebViewString to communicate between html and app.
To be able to send many data, i use JSON. So when a Button is clicked in APP ( or whatever event you want ) you can prepare JSON string to contain your data for the HTML. and send the JSON as WebViewString.

In HTML you have to catch WebViewString change event (with javascript) and process the JSON data.
And the opposite, when you click a Button or whatever event you want, prepare JSON string and send it back to app with WebViewString.

Parse the JSON and take your options/data.

3 Likes

It is not working for me on Android 5.0 (Tested in Companion)

My Blocks:

Result:

2 Likes

ChangeLog Version 8

New Blocks





Changes

  • Added id parameter to OnNewWindowRequest and removed the url parameter
  • Clicked url will open Screen1 with list of url and 1
  • Web Shortcut will open Screen1 with a list of url and 2
  • Events will be only triggered for active webview (Set using SetWebView method)

Bug Fixes

  • Fixed bug in UploadFile method
    Thanks to @nikzdreamer2001 and @wwwmaster2006 for reporting the bug
  • Fixed bug in CurrentId method (it was not resetting after removing webview)
  • Fixed bug in GetCookies method (it was returning null instead of empty string)
    Thanks to @sonumohammad333 for reporting bug

Documentation

Since first post is no longer editable (lag issues) so here is documentation for new blocks.

  • On Close Window Request
    Event triggered when a window needs to be closed
    image
    id ~ int
  • Create Shortcut
    Creates a shortcut of given website on home screen
    image
    url ~ text
    iconPath ~ text
    title ~ text
  • Load In New Window
    Loads requested url in given webview
    image
    id ~ int
  • Pause WebView
    Does a best-effort attempt to pause any processing that can be paused safely, such as animations and geolocation. Note that this call does not pause JavaScript.
    image
    id ~ int
  • Post Data
    Loads the URL with postData using ā€˜POSTā€™ method into active WebView.
    image
    url ~ text
    data ~ text
  • Resume WebView
    Resumes the previously paused WebView.
    image
    id ~ int
  • Set Cookies
    image
    url ~ text
    cookieString ~ text
  • Initial Scale
    Sets the initial scale for active WebView. 0 means default. If initial scale is greater than 0, WebView starts with this value as initial scale.
    image
    Accepts int

Thank you everyone :heart:

11 Likes

You are awesome

I just reported the bug
You fixed it in a glance

2 Likes

CAn anyone explain onnewwindowreq blocks plzā€¦

1 Like

this can help you:

3 Likes

Ok thanks will try it :+1:

2 Likes

I donā€™t know, if itā€™s a mistake or if I misconfigured the extension but it was commented on a website and asked me to log in to Facebook so I could post my comment but I click the start button and nothing appears, not even a pop-up window

1 Like

Hello again.
Image upload problem still continues.

I tried one by one with file: //, content: // and image: //. But the result has not changed.

It gives an error like this: Duplicate showFileChooser result

1 Like

Have you enabled FileAccess ?
It should be enabled if you want to upload files.

You will have to handle pop ups from yourself using OnNewWindowRequest and LoadInNewWindow.
Also be sure to check if Js is enabled.

2 Likes

:frowning: Can you tell me how I can do this?

2 Likes

Using this property block.

3 Likes

Where am I doing wrong?
file-upload-5

You are setting property without creating webview.
You can set property only after creating webview and making that webview to active.

3 Likes