CustomWebView : An extended form of Web Viewer

Have a look at how each extension is applied and used.
Read all the documentation for each.
You will get your answer.

Please don't use caps like that!

I actually got startled after reading that message

Using caps is like shouting, which the community does not like :slight_smile:

How to trigger file picker of the html. i tried with evaluate js document.getElementById('fileInput').click(); but it not working

You can search in community like this:
https://community.appinventor.mit.edu/search?expanded=true&q=Customwebview%20file%20picker

Or in this topic as well.
https://community.appinventor.mit.edu/search?expanded=true&q=file%20picker%20topic%3A9934

I'm using the custom web viewer extension and I want a way to save the page as a PDF.

perhaps

for one and lots of others if you search the Forum and Internet using

App Inventor save custom web extension ; Image to PDF etc.

Perhaps this ?

Any update on this?

You can download the aix from GitHub repository.

Saving a Blob/RAM File to Storage in Android 11+​

I am building a File Compressor app where the compression happens entirely inside the browser (using JavaScript in an HTML file). The file is generated successfully in the RAM as a Blob URL (blob:http://...).

What I have achieved so far:

  1. ​I am using CustomWebView to load the HTML.
  2. ​I successfully triggered the download using a Javascript Interface.
  3. ​I converted the Blob to a Base64 string using the XMLHttpRequest method in the OnDownloadNeeded event.
  4. ​I am using the KIO4_Base64 extension to decode and save the string.

The Problem:

I can save the file as a .txt or .zip successfully, but I am struggling with the File Path and Permissions on Android 10/11+.

  • ​If I use StringToFile, it sometimes fails or saves a corrupted file.
  • ​If I use StringToFileASD, it saves to the App Specific Directory (Private folder), but I want the user to see it in their main Downloads folder.

My Question:

Does anyone have a working block logic or a recommended extension that can:

  1. ​Take a Base64 string (from the Blob).
  2. ​Decode it to a binary ZIP file.
  3. ​Save it directly to /storage/emulated/0/Download/ on newer Android versions (Scoped Storage)?

​Any help or guidance on how to move the file from ASD to Downloads would be greatly appreciated!

You can download the blob directly using customwebview, no need for base64 encoding. See the documentation.

@Crestor

Ensure that the base64 decoder is supplied with just a base64 string, it should not have the datauri stuff at the beginning.

Where is your "download" currently saving this blob zip/txt ?

Don't know what that means.

Back on topic, did you see my previous post that tells you that you can download a blob directly to a file ?

I actually tried the direct download method first, but it seems to fail because I am dealing with a dynamically generated Blob URL (blob:http://...), not a standard HTTP link.
From what I've tested, the native Android Download Manager usually fails with Blob URLs on Android 11+ (Scoped Storage) because it can't access the browser's internal RAM. That is why I switched to the Base64 approach—it's the only way I found to successfully extract the data so far.
If you have a working Block logic that can download a blob: URL directly to the /Download/ folder on Android 11+ without using Base64, could you please share a screenshot? I would love to use a simpler method if it works!"

You didn't find the WebViewExtra extension :wink:


It is my current blocks... I have imported WebViewExtra extension but not understand how to implement its block... Can you give me block image that I need to complete it?(post deleted by author)

Do not mix webviewextra with customwebview, they are two different things altogether. If you want to know how to use webviewextra then please ask on that topic. Webviewextra uses the native webviewer, customwebview does it's own thing

Did you not see the blocks provided above by @vknow360 that show how you download a blob url with customwebview ?

On coustomWebViewer extension i can't get download helper extension... When I searched on internet I get 2 com.sunny.CustomWebView file.
One about 78kb and other about 295kb

When I import 295kb file I get only CustomWebView extension there is no DownloadHelper extension... But when I import 78kb file it have both 2 extention but when I change its block it not have all blocks.

So I try to use WebViewExtra extension :pleading_face::sweat:

Import both aix files.