cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <>
Subject [jira] [Updated] (CB-12780) Add option to setMixedContentMode on Android
Date Mon, 17 Jul 2017 20:52:00 GMT


Joe Bowser updated CB-12780:
    Priority: Minor  (was: Major)

> Add option to setMixedContentMode on Android
> --------------------------------------------
>                 Key: CB-12780
>                 URL:
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: cordova-android
>    Affects Versions: 7.0.0
>            Reporter: Mike M.
>            Priority: Minor
> We're currently developing an application that streams audio from a continuous stream
over http. We have an existing web application served over https. The audio streams, which
are built using HTML5 audio, are served in http only.
> On Android, the WebView won't load our audio stream because of a mixed content error.
> According to my research, this is because on Android, as of API level 20, the WebView
gets a mixedContentMode of {{MIXED_CONTENT_NEVER_ALLOW}} by default (see the documentation
This is especially frustrating as it doesn't match [what modern browsers do|],
which is to allow "passive" mixed content that doesn't interact with the page directly like
audio/video streams. So in the end, the WebView doesn't behave like the browser, which breaks
our application.
> When I change the API target level to 19, the resource gets loaded successfully. However,
sticking with API level 19 isn't a long-term solution. 
> As seen in [the documentation|],
there is a way to let Android treat mixed content like the browser, which involves setting
the MixedContentMode WebSetting to {{MIXED_CONTENT_COMPATIBILITY_MODE}}. However, as I understand
it (I'm new to Cordova), this would require me to add custom code to the generated android
activity code, which is discouraged and which I would prefer not to do.
> It would be nice if cordova-android added a configuration setting for mixed content which
would get translated into setting the MixedContentMode WebSetting. It could look something
> {code:xml}
>     <platform name="android">
>         <preference name="android-mixedContentMode" value="COMPATIBILITY_MODE" />
>     </platform>
> {code}
> That would make the code more maintainable and expresses what we need concisely.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message