Browse Source

Fixed a setting, lowered priority on a thread

master
Anthony Restaino 9 years ago
parent
commit
59c720d7d8
  1. 1
      app/src/main/java/acr/browser/lightning/object/SearchAdapter.java
  2. 7
      app/src/main/java/acr/browser/lightning/view/LightningView.java

1
app/src/main/java/acr/browser/lightning/object/SearchAdapter.java

@ -90,6 +90,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
mSearchDrawable = ThemeUtils.getThemedDrawable(context, R.drawable.ic_search, mDarkTheme); mSearchDrawable = ThemeUtils.getThemedDrawable(context, R.drawable.ic_search, mDarkTheme);
mBookmarkDrawable = ThemeUtils.getThemedDrawable(context, R.drawable.ic_bookmark, mDarkTheme); mBookmarkDrawable = ThemeUtils.getThemedDrawable(context, R.drawable.ic_bookmark, mDarkTheme);
mHistoryDrawable = ThemeUtils.getThemedDrawable(context, R.drawable.ic_history, mDarkTheme); mHistoryDrawable = ThemeUtils.getThemedDrawable(context, R.drawable.ic_history, mDarkTheme);
delete.setPriority(Thread.MIN_PRIORITY);
delete.start(); delete.start();
} }

7
app/src/main/java/acr/browser/lightning/view/LightningView.java

@ -317,6 +317,9 @@ public class LightningView {
if (mPreferences.getJavaScriptEnabled()) { if (mPreferences.getJavaScriptEnabled()) {
settings.setJavaScriptEnabled(true); settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true); settings.setJavaScriptCanOpenWindowsAutomatically(true);
} else {
settings.setJavaScriptEnabled(false);
settings.setJavaScriptCanOpenWindowsAutomatically(false);
} }
if (mPreferences.getTextReflowEnabled()) { if (mPreferences.getTextReflowEnabled()) {
@ -707,12 +710,12 @@ public class LightningView {
@Override @Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (mAdBlock.isAd(request.getUrl().getHost())) { if (mAdBlock.isAd(request.getUrl().getHost())) {
ByteArrayInputStream EMPTY = new ByteArrayInputStream("".getBytes()); ByteArrayInputStream EMPTY = new ByteArrayInputStream("".getBytes());
return new WebResourceResponse("text/plain", "utf-8", EMPTY); return new WebResourceResponse("text/plain", "utf-8", EMPTY);
} }
}
return super.shouldInterceptRequest(view, request); return super.shouldInterceptRequest(view, request);
} }

Loading…
Cancel
Save