Code Monkey home page Code Monkey logo

customwebview's People

Contributors

vknow360 avatar xomadev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

customwebview's Issues

Request for API upgrade.

Hello! First of all, I would like to express my sincere gratitude for this project, as it has provided me with significant convenience and serves as an excellent extension.
However, the current API required for this extension is 21, which is somewhat outdated for the latest Android version. I was wondering if there is any plan to create a higher version? I'm not sure if this would be a lot of trouble, But I still want to ask.Thank you.

Feature Request: Support for downloading `blob` URLs

Could support be added to download blob: URLs? I have done some research on how this could be done. I found this issue which sounds like the current problem with downloading blob URLs. I made the following code to take care of a few concerns I had about the examples' code.

Code

(async function() {
    const blobUrl = null; // Some blob URL from App Inventor.
    const { revokeObjectURL } = URL; // Backup the original URL.revokeObjectURL method
    const restoreRevokeObjectURL = () => URL.revokeObjectURL = revokeObjectURL; // Restore the URL.revokeObjectURL method
    
    let Blob2Base64Finished = false;
	
    // Temporarily make the blob URL being downloaded not revocable.
    (function(url) {
        url.revokeObjectURL = objectUrl => {
            // Incase a different blob URL needs to be revoked
            if(objectUrl != blobUrl) {
                revokeObjectURL(objectUrl);
            }
			
            // Skip the interval check if it already completed
            if(Blob2Base64Finished === true) {
                revokeObjectURL(objectUrl);
                restoreRevokeObjectURL();
            } else {
                const interval = setInterval(() => {
                    if(Blob2Base64Finished === true) {
                        clearInterval(interval);

                        revokeObjectURL(objectUrl);
                        restoreRevokeObjectURL();
                    }
                }, 100);
            }
        }
    })(URL)
	
    // Convert a blob to a data URL
    function Base64PromiseFileReader(blob) {
        return new Promise((resolve, reject) => {
            const reader = new FileReader();

            reader.addEventListener("loadend", () => resolve(reader.result));
            reader.addEventListener("onerror", e => reject(e));

            reader.readAsDataURL(blob);
        });
    }
	
    function readBlobUrl(blobUrl) {
        return new Promise(async (resolve, reject) => {
            try {
            	// Convert the blob URL to a blob
                const blob = await (await fetch(blobUrl)).blob();
                
                // Convert the blob to a data URL
                resolve(await Base64PromiseFileReader(blob));
            } catch(e) {
                reject(e.message == "Failed to fetch" ? "Blob Revoked" : e);
            }
        });
    }
	
    const result = await readBlobUrl(blobUrl); // Get the data URL form the blob URL
    Blob2Base64Finished = true; // Tell the modified URL.revokeObjectURL that converting the blob to a data URL was completed
    
    // Gives the modified URL.revokeObjectURL a chance to run before replacing it with the original
    setTimeout(() => restoreRevokeObjectURL(), 150);
	
    // Return `result` to the app to be downloaded
})();

I don't know how hard it would be to actually implement the java part of this, but it looks like it would be pretty simple.

Thanks for this amazing extension @vknow360!

Beta: Dark Mode doesn't work on Android 13+

SetDarkMode in the beta version is using the setForceDark function of Webview which isn't supported as of Android 13. Looks like we should be using setAlgorithmicDarkeningAllowed instead.

See the note below:

The deprecated [setForceDark](https://developer.android.com/reference/androidx/webkit/WebSettingsCompat#setForceDark(android.webkit.WebSettings,int)) and related API are no-ops in apps with targetSdkVersion ≥ [TIRAMISU](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#TIRAMISU()), but they still apply to apps with targetSdkVersion<[TIRAMISU](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#TIRAMISU()).

More available here.

Which is the latest?

com.sunny.CustomWebView-modified.aix ( the smaller one)
or
com.sunny.CustomWebView.aix
?

JS Alert causes WebView to freeze

Hello, first of all, thanks for this wonderful extension.

i am experiencing a problem, that whenever my web application calls an JS Alert, the WebView completely freezes.
Even when using the function blocks OnJsAlert & DismissJsAlert like in the screenshot below, i need to completely close the app to continue using the browser.

image

According to https://community.appinventor.mit.edu/t/alert-function-custom-webview/61882/10 and other forum posts, i am not the only one with this issue.

ADB is not very helpful (i think):

image

Would be great if this issue could easily be fixed. Thanks!

Deeplink NOT SUPPORTING

I am using version 10,when i click Whatsapp share button in my website through app it is not opening anything
blocks (3)

How to Facebook Login?

I can't login to facebook even though I use "useragent". It gives a warning that you cannot log in from an embedded browser. How can I solve this problem?

Not work form file

the web site OK but when I click on select file form not work. I remember that this worked without problems since I developed an app before and if it worked. Could it be that we have to use another extension? Help please (urgent!!)
Hola!!, necesito ayuda. Uso la extensión CustomWebView en inventor, veo el sitio web bien, pero cuando hago clic en el formulario de selección de archivo no funciona. Recuerdo que esto funcionó sin problemas ya que desarrollé una aplicación antes y si funcionó. ¿Será que tengo que usar otra extensión? Ayuda por favor (¡urgente!!)

UPI apps not opening if user selects any of them inside CustomWebView

There is a payment option in my page which is loading inside CustomWebView. I used Chrome Custom Tab in Kodular which opens UPI apps like PhonePe, gpay, paytm etc if user selects them. Now i want to implement your CustomWebView. everything works well but UPI apps not opening/working as expected if user selects any of them inside CustomWebView. It opens Playstore Page of the app of user select anyone of them. For ex: if user selects Gpay then browser goes to playstore page of Gpay.

Note: i tested and found that, everything works good in companion. But in live app, playstore page opening.

would you like to fix the issue ?

Kodular - Permission Issue

If a website requires access to camera or microfone this two permissions are needed,

android.webkit.resource.VIDEO_CAPTURE
android.webkit.resource.AUDIO_CAPTURE

webview raise the PermissionRequest but cant grant this two "missing grant permision blocks from version 4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.