File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
app/src/main/java/at/xtools/pwawrapper Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,6 @@ public Constants(){}
1818 // lower it, if you've got server-side rendering (e.g. to 35),
1919 // bump it up to ~98 if you don't have SSR or a loading screen in your web app
2020 public static int PROGRESS_THRESHOLD = 65 ;
21+ // turn on/off mixed content (both https+http within one page) for API >= 21
22+ public static boolean ENABLE_MIXED_CONTENT = true ;
2123}
Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ public void setupWebView() {
9191 webSettings .setAppCacheEnabled (true );
9292 webSettings .setDatabaseEnabled (true );
9393
94+ // enable mixed content mode conditionally
95+ if (Constants .ENABLE_MIXED_CONTENT
96+ && Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
97+ webSettings .setMixedContentMode (WebSettings .MIXED_CONTENT_COMPATIBILITY_MODE );
98+ }
99+
94100 // retrieve content from cache primarily if not connected
95101 forceCacheIfOffline ();
96102
You can’t perform that action at this time.
0 commit comments