handle edit-text events correctly

This commit is contained in:
Philipp Schaefer
2013-05-09 13:20:38 +02:00
parent 77010fc8ed
commit 2e50b4fedd
2 changed files with 10 additions and 32 deletions

View File

@ -73,6 +73,13 @@ public class IITC_WebView extends WebView {
@Override
public void loadUrl(String url) {
// if in edit text mode, don't load javascript otherwise the keyboard closes.
HitTestResult testResult = this.getHitTestResult();
if (url.startsWith("javascript:") && testResult != null && testResult.getType() == HitTestResult.EDIT_TEXT_TYPE)
{
Log.d("iitcm", "in insert mode. do not load script.");
return;
}
if (!url.startsWith("javascript:")) {
// force https if enabled in settings
SharedPreferences sharedPref = PreferenceManager