Toni Toni Chopper
Toni Toni Chopper

Reputation: 1851

Android WebView iframe data url

Does Android WebView support data url in the iframe?

This code crashes my app:

myDiv.innerHTML = '<iframe src="data:text/html;base64,PGh0bWw+DQogICAgPGhlYWQ+PC9oZWFkPg0KICAgIDxib2R5Pg0KICAgIAlWSUNUT1JZIEhFWSBIRVkNCiAgICA8L2JvZHk+DQo8L2h0bWw+" id="my_iframe" width="100%" height="100%" frameborder="0" onLoad="iFrameLoaded();"></iframe>';

The data decoded is:

<html>
    <head></head>
    <body>
        VICTORY HEY HEY
    </body>
</html>

Platform is: Samsung Galaxy S2, Android version 2.3.5

UPDATE: I forgot to add that this works perfectly in Chrome and Firefox but doesn't seem to be supported in Android WebView.

Upvotes: 0

Views: 1385

Answers (2)

Toni Toni Chopper
Toni Toni Chopper

Reputation: 1851

All my tests tell me that it doesn't (for versions > 2.3.5 I dont' know)

Upvotes: 1

Maikel Bollemeijer
Maikel Bollemeijer

Reputation: 6575

Do you have JS enabled ?

webView.getSettings().setJavascriptEnabled(true);

here is the Android Doc about WebViews

hope this help

Upvotes: 0

Related Questions