Fixed issue where target="_blank" URLs wouldn't open correctly
This commit is contained in:
parent
dd8893c952
commit
0b03e569fb
@ -139,8 +139,6 @@ public class BrowserActivity extends Activity implements BrowserController {
|
|||||||
|
|
||||||
private Activity mActivity;
|
private Activity mActivity;
|
||||||
|
|
||||||
private CookieManager mCookieManager;
|
|
||||||
|
|
||||||
private final int API = android.os.Build.VERSION.SDK_INT;
|
private final int API = android.os.Build.VERSION.SDK_INT;
|
||||||
|
|
||||||
private Drawable mDeleteIcon;
|
private Drawable mDeleteIcon;
|
||||||
@ -1050,7 +1048,7 @@ public class BrowserActivity extends Activity implements BrowserController {
|
|||||||
|
|
||||||
protected synchronized void newTab(String url, boolean show) {
|
protected synchronized void newTab(String url, boolean show) {
|
||||||
mIsNewIntent = false;
|
mIsNewIntent = false;
|
||||||
LightningView startingTab = new LightningView(mActivity, url, mCookieManager);
|
LightningView startingTab = new LightningView(mActivity, url);
|
||||||
if (mIdGenerator == 0) {
|
if (mIdGenerator == 0) {
|
||||||
startingTab.resumeTimers();
|
startingTab.resumeTimers();
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ import android.view.GestureDetector.SimpleOnGestureListener;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnTouchListener;
|
import android.view.View.OnTouchListener;
|
||||||
import android.webkit.CookieManager;
|
|
||||||
import android.webkit.*;
|
import android.webkit.*;
|
||||||
import android.webkit.WebSettings.LayoutAlgorithm;
|
import android.webkit.WebSettings.LayoutAlgorithm;
|
||||||
import android.webkit.WebSettings.PluginState;
|
import android.webkit.WebSettings.PluginState;
|
||||||
@ -67,7 +66,7 @@ public class LightningView {
|
|||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public LightningView(Activity activity, String url, CookieManager cookieManager) {
|
public LightningView(Activity activity, String url) {
|
||||||
|
|
||||||
mActivity = activity;
|
mActivity = activity;
|
||||||
mWebView = new WebView(activity);
|
mWebView = new WebView(activity);
|
||||||
@ -139,8 +138,12 @@ public class LightningView {
|
|||||||
initializeSettings(mWebView.getSettings(), activity);
|
initializeSettings(mWebView.getSettings(), activity);
|
||||||
initializePreferences(activity);
|
initializePreferences(activity);
|
||||||
|
|
||||||
if (url != null && !url.trim().isEmpty()) {
|
if (url != null) {
|
||||||
|
if (!url.trim().isEmpty()) {
|
||||||
mWebView.loadUrl(url);
|
mWebView.loadUrl(url);
|
||||||
|
} else {
|
||||||
|
//don't load anything, the user is looking for a blank tab
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mHomepage.startsWith("about:home")) {
|
if (mHomepage.startsWith("about:home")) {
|
||||||
mSettings.setUseWideViewPort(false);
|
mSettings.setUseWideViewPort(false);
|
||||||
@ -902,7 +905,7 @@ public class LightningView {
|
|||||||
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture,
|
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture,
|
||||||
Message resultMsg) {
|
Message resultMsg) {
|
||||||
mBrowserController.onCreateWindow(isUserGesture, resultMsg);
|
mBrowserController.onCreateWindow(isUserGesture, resultMsg);
|
||||||
return isUserGesture;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user