Browse Source

Fixed issue where target="_blank" URLs wouldn't open correctly

master
Anthony Restaino 10 years ago
parent
commit
0b03e569fb
  1. 4
      src/acr/browser/lightning/BrowserActivity.java
  2. 13
      src/acr/browser/lightning/LightningView.java

4
src/acr/browser/lightning/BrowserActivity.java

@ -139,8 +139,6 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -139,8 +139,6 @@ public class BrowserActivity extends Activity implements BrowserController {
private Activity mActivity;
private CookieManager mCookieManager;
private final int API = android.os.Build.VERSION.SDK_INT;
private Drawable mDeleteIcon;
@ -1050,7 +1048,7 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -1050,7 +1048,7 @@ public class BrowserActivity extends Activity implements BrowserController {
protected synchronized void newTab(String url, boolean show) {
mIsNewIntent = false;
LightningView startingTab = new LightningView(mActivity, url, mCookieManager);
LightningView startingTab = new LightningView(mActivity, url);
if (mIdGenerator == 0) {
startingTab.resumeTimers();
}

13
src/acr/browser/lightning/LightningView.java

@ -22,7 +22,6 @@ import android.view.GestureDetector.SimpleOnGestureListener; @@ -22,7 +22,6 @@ import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.webkit.CookieManager;
import android.webkit.*;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebSettings.PluginState;
@ -67,7 +66,7 @@ public class LightningView { @@ -67,7 +66,7 @@ public class LightningView {
@SuppressWarnings("deprecation")
@SuppressLint("NewApi")
public LightningView(Activity activity, String url, CookieManager cookieManager) {
public LightningView(Activity activity, String url) {
mActivity = activity;
mWebView = new WebView(activity);
@ -139,8 +138,12 @@ public class LightningView { @@ -139,8 +138,12 @@ public class LightningView {
initializeSettings(mWebView.getSettings(), activity);
initializePreferences(activity);
if (url != null && !url.trim().isEmpty()) {
mWebView.loadUrl(url);
if (url != null) {
if (!url.trim().isEmpty()) {
mWebView.loadUrl(url);
} else {
//don't load anything, the user is looking for a blank tab
}
} else {
if (mHomepage.startsWith("about:home")) {
mSettings.setUseWideViewPort(false);
@ -902,7 +905,7 @@ public class LightningView { @@ -902,7 +905,7 @@ public class LightningView {
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture,
Message resultMsg) {
mBrowserController.onCreateWindow(isUserGesture, resultMsg);
return isUserGesture;
return true;
}
@Override

Loading…
Cancel
Save