How to use CustomWebView extension?

Hi everyone :slightly_smiling_face:
Since I am getting a lot of questions related to CustomWebView extension so I decided to create a guide to show how we can do various tasks with the extensions in different parts.

Use JavaScript functions (also for webviewer)

1.Create and Set Webview
As we know that to use the extension we have to create and make a webview active which can be done in following way:

image
Since JS is by default enabled in extension so there is no need to set it manually.

If you are using WebViewer then you can skip this step

2.Load website
To run JS functions I am going to use my website so I shall load it first.

image

It will load this page:

3.Fill textboxes
We need element’s id to perform these steps that we can easily get using Inspect feature of browsers.

Js: document.getElementById("text_box_id").value = "test_value";

Username and Password textboxes have id user_login and login_pass on the website so blocks will be these:

Result:

4.Toggle Checkbox
Checkbox is similar to button so we shall have to call click() function.
Js: document.getElementById("check_box_id").click();

I got rememberme as id so blocks will be these:

Result:

To uncheck it call the function again.

5.Click on a button
To perform onClick function we shall have to call click() for that element.
Js: document.getElementById("btn_id").click();

For example, login page has a button named Log In whose id is wp-submit so blocks will like this:

But since username and password are wrong so you will get this error:

Ad Blocker

1.Set up webview
It is same as previous:

2.Block Ads
To block ads we need to specify ad hosts which we want to block.
Download File: ad host.txt (54.7 KB)
Thanks to @themaayur
It conatins 3k+ ad hosts.
Your blocks should be like this:

You can also set ad hosts from file.For that you will have to upload file to assets and read it at runtime.

3.Testing
To test it, I tried to load this website.
Here is the result:

When using a normal browser:

Hope it helps! :grin:

21 Likes
How to perform click in Custom Web Viewer
How to enable download button
Webview auto click
Login code for a site (not mine)
How to sign in to webview using firebase sign in credential
Call an action from WebView
Err_unknown_url_scheme whatsapp not open
How to use Custom WebView
CustomWebView : An extended form of Web Viewer
Webviewer auto click button [I Pay you]
How to send text inside textbox to a website textbox
Send Text from app to website Text Box and then enter and get Download Link from the Website to download the File in My app.
Image uploading not working on homework site app
How to solve this deeplink problem
Custom Webview Data Input
Help Me CustomWebView : An extended form of Web Viewer
CustomWebView how refresh web app?
How To Get Response Content In Webviwer Like Web Component?
How to Get Desktop View for a specific site?
Fill website details using javascript in web view
Set Value On Custom WebView Problem!
Favorite button problem
Html code with geolocation
Unable to build apk
Is this a bug or I did some mistake?
CustomWebView : An extended form of Web Viewer
CustomWebView : An extended form of Web Viewer
Shield Browser - #1 Most Secure & Easy to use Privacy Browser
CustomWebView : An extended form of Web Viewer
Full screen button not enable in webview
CustomWebView : An extended form of Web Viewer
CustomWebView : An extended form of Web Viewer
Fill website details using javascript in web view
How to click google search button?
CustomWebView : An extended form of Web Viewer
CustomWebView : An extended form of Web Viewer
CustomWebView : An extended form of Web Viewer
Block Ads in Webview
Blocking ads in webview with javascript
Get a value from a website and connect it with a result
How to automatically get playing embed video link for download in webview
Web component help
Webview print: how could i activate?
Js evaluvation click
I can't upload an image to webview
CustomWebView : An extended form of Web Viewer
CustomWebView : An extended form of Web Viewer

This is helpful to me thanks for creating this guide

Which is the button_id here?

image

1 Like

You need to include the id.

id=“btn_id”

Yeah but for that we need the ID of that button in that web page…

Which is the ID in the above pic? Looks like it is signin-captcha, right?

Try this, Maybe :
document.querySelector(’#sigin-captcha).addEventListener(‘click’, () => {
document.querySelector(‘button’).click();
});

Or if possible, put an id on the button.

1 Like

Hi I tried your code but it didn’t work…

Haw to connect Web viewer component to CustomWebView Extension

Not work . Plz Build a demo.aia file
am trying 7 months +
webviwer auto button click in webpage java script

@vknow360 is Suspended from Community, contact him in AI2 Community or through his Website.

2 Likes

am contact website no replay

:point_up_2::point_up_2::point_up_2::point_up_2::point_up_2:

1 Like

Javascript alert promt is not showing its hidden … But i cant conform the alert …

I tested all the blocks but i cant proceed to next the whole app will stucks and no process will coccurs

How can access the alert and click ok button

the author of the extension has been suspended in this community…
for questions about the extension, please ask on his webpage here
http://sunnythedeveloper.epizy.com/2020/05/13/customwebview-an-extended-form-of-web-viewer/

Taifun

1 Like