Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3281 Fixes #3282 Only show URL buttons for http/https uris #3287

Merged
merged 2 commits into from
Apr 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.TypedValue;
import android.webkit.URLUtil;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -316,8 +317,8 @@ public void onChanged(Spannable aUrl) {
!isFocused.getValue().get() &&
!isLibraryVisible.getValue().get() &&
!UrlUtils.isContentFeed(getApplication(), aUrl.toString()) &&
!UrlUtils.isFileUri(aUrl.toString()) &&
!UrlUtils.isPrivateAboutPage(getApplication(), aUrl.toString()) &&
(URLUtil.isHttpUrl(aUrl.toString()) || URLUtil.isHttpsUrl(aUrl.toString())) &&
(
(SettingsStore.getInstance(getApplication()).getTrackingProtectionLevel() != ContentBlocking.EtpLevel.NONE) ||
isPopUpAvailable.getValue().get() ||
Expand All @@ -332,8 +333,9 @@ public void onChanged(Spannable aUrl) {
@Override
public void onChanged(ObservableBoolean o) {
isUrlBarIconsVisible.postValue(new ObservableBoolean(
isLoading.getValue().get() ||
isInsecureVisible.getValue().get()
!isLibraryVisible.getValue().get() &&
(isLoading.getValue().get() ||
isInsecureVisible.getValue().get())
));
}
};
Expand Down Expand Up @@ -389,10 +391,6 @@ public void setUrl(@Nullable Spannable url) {

String aURL = url.toString();

if (isLibraryVisible.getValue().get()) {
return;
}

int index = -1;
try {
aURL = URLDecoder.decode(aURL, "UTF-8");
Expand Down