Added option for empty user agent if the user sets an empty string to work around webview limitations
This commit is contained in:
parent
dd18526ddf
commit
04c9f75a90
@ -737,7 +737,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
||||
if (mSearch.hasFocus()) {
|
||||
searchTheWeb(mSearch.getText().toString());
|
||||
}
|
||||
} else if ((keyCode == KeyEvent.KEYCODE_MENU) && (Build.VERSION.SDK_INT <= 16)
|
||||
} else if ((keyCode == KeyEvent.KEYCODE_MENU)
|
||||
&& (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN)
|
||||
&& (Build.MANUFACTURER.compareTo("LGE") == 0)) {
|
||||
// Workaround for stupid LG devices that crash
|
||||
return true;
|
||||
@ -747,7 +748,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
|
||||
|
||||
@Override
|
||||
public boolean onKeyUp(int keyCode, @NonNull KeyEvent event) {
|
||||
if ((keyCode == KeyEvent.KEYCODE_MENU) && (Build.VERSION.SDK_INT <= 16)
|
||||
if ((keyCode == KeyEvent.KEYCODE_MENU)
|
||||
&& (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN)
|
||||
&& (Build.MANUFACTURER.compareTo("LGE") == 0)) {
|
||||
// Workaround for stupid LG devices that crash
|
||||
openOptionsMenu();
|
||||
|
@ -365,7 +365,11 @@ public class LightningView {
|
||||
settings.setUserAgentString(Constants.MOBILE_USER_AGENT);
|
||||
break;
|
||||
case 4:
|
||||
settings.setUserAgentString(mPreferences.getUserAgentString(mDefaultUserAgent));
|
||||
String ua = mPreferences.getUserAgentString(mDefaultUserAgent);
|
||||
if (ua == null || ua.isEmpty()) {
|
||||
ua = " ";
|
||||
}
|
||||
settings.setUserAgentString(ua);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user