CustomWebView : An extended form of Web Viewer

​Wow, this approach looks like a game-changer! Bypassing the OnDownloadNeeded listener completely would solve so many of my permission headaches on Android 11+.

​I am definitely going to try this 'Base64 to WebViewString' method. I just have two questions before I rewrite my code:

  1. ​String Limit: Since this is a File Compressor app, the Base64 strings might be quite large (e.g., 5MB to 10MB). Have you tested if window.AppInventor.setWebViewString has a character limit or if it causes the app to freeze with large data?
  2. ​The Async Logic: You mentioned it needs to be an async function to return the promise correctly. Could you share a small snippet of how you structure that async/await wrapper around the FileReader?

​Thanks a lot for this suggestion, it really helps!

I show it above

String Limit

Technically, I believe it should be able to handle 5-10mb string sizes (you understand that base64 is generally @ 33% bigger than the original file). In practical terms you may hit a wall. Maybe you are just not compressing enough!! :wink:

I need to issue a correction.

In your html/javascript you are creating the blob, so you already have the blob, therefore there is no need to "fetch" the blob from a blobUrl, your code will/should work OK to convert the blob to a base64, and you can then create the blobUrl for file download purposes.

If you only want to return the base64 to the app then as I showed, use the webviewstring to pass the base64 string to the app. You can programmatically remove the datauri section like so:

let base64data = reader.result.split(',')[1];

So instead of returning, for example:

data:text/plain;base64,SGVsbG8sIHdvcmxkIQ==

to the app, you only return:

SGVsbG8sIHdvcmxkIQ==

Hmm

This is not recommended but you CAN move it to the downloads folder with the "file" component

How do i enable dark mode for sites like google or duck duck go, i have a theme in my app that i want to sync with all websites, I tried the setdarkmode but it doesnt work

It works from my website. Sorry for the late reply

Using this extension how can I download an .SB3 file? it gives me some wierd http/https error and says it cant download. I will send my code.

Please show the error.

You are attempting to download a blob.

You need to use the specific blob method and event block for that. This has been pointed out several times in this topic.

How would I know? This post has been going on for nearly 6 years?

Did you ever figure it out? I'm trying to do the same thing on my stupid school chromebook. Also you mentioned a second file explorer?

Quick Answer

CustomWebView : An extended form of Web Viewer - #723 by vknow360

Long Answer:
Click on the search icon
Enter search query (blob or download blob in this case)
Select in this topic option
Now you have to read last few answers

Is there a way I can download only the download helper? I want to use customwebview and download helper, but not browser prompts. I am trying to make a project using only these 2 extensions. Bare bones, nothing un-needed.

Don't believe so, they all come together. Just don't drag it into your designer if you don't want to use the single method and event it provides.

Yeah but in the extensions tab it still shows it. Also do you know what is faster customwebview or WebViewextra?

They both essentially use an android webview. CustomWebView may be more optimised than my WebViewExtra regarding the underlying code.

May all come down to the webpages you are loading. You could run tests and report back ?

Okay

It took 23 seconds for customwebview to initialize with a 87 blocks.


WebViewExtra too only 21.73 seconds to initialize with a minimum of 32 blocks

b