user2259824
user2259824

Reputation: 135

Android browsers render dart webpages but webviews do not

When I load a dart generated webpage from android browsers it renders perfectly. When I try to render on webview, images do not load. Any ideas how to render same webpage on webview?

Android version : same situation on api 8 15 and 17

javascript (dart2js output) gives uncaught typeerror: cannot read property 'constructor' of null

I think this is because images never loaded.

I set all the permissions on webview. I set chrome client. I set webview client as well

WebView engine = (WebView) findViewById(R.id.web_engine);
    engine.getSettings().setJavaScriptEnabled(true); 
    engine.getSettings().setAllowFileAccess(true);
    engine.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    engine.getSettings().setLoadsImagesAutomatically(true);
    engine.getSettings().setAllowUniversalAccessFromFileURLs(true);
    engine.getSettings().setAllowContentAccess(true); 
    engine.getSettings().setLoadsImagesAutomatically(true);

Upvotes: 1

Views: 313

Answers (1)

Danny Tuppeny
Danny Tuppeny

Reputation: 42333

Prior to Kitkat (4.4), the WebView was not based on Chrome. Based on the date of this post, my guess is that was your problem.

From 4.4 onwards, there is a Chrome-based WebView, but it's still not completely the same as Chrome. There are some details on the differences and what's supported on the Chrome developer site here:

https://developer.chrome.com/multidevice/webview/overview

Upvotes: 1

Related Questions