Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 18270f0

Browse files
authored
Fixes #3281 Fixes #3282 Only show URL buttons for http/https uris (#3287)
* Only show URL buttons for http/https uris * Also hide URL bar icons if in library
1 parent 76a4b30 commit 18270f0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/src/common/shared/org/mozilla/vrbrowser/ui/viewmodel/WindowViewModel.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.text.SpannableString;
77
import android.text.style.ForegroundColorSpan;
88
import android.util.TypedValue;
9+
import android.webkit.URLUtil;
910

1011
import androidx.annotation.NonNull;
1112
import androidx.annotation.Nullable;
@@ -316,8 +317,8 @@ public void onChanged(Spannable aUrl) {
316317
!isFocused.getValue().get() &&
317318
!isLibraryVisible.getValue().get() &&
318319
!UrlUtils.isContentFeed(getApplication(), aUrl.toString()) &&
319-
!UrlUtils.isFileUri(aUrl.toString()) &&
320320
!UrlUtils.isPrivateAboutPage(getApplication(), aUrl.toString()) &&
321+
(URLUtil.isHttpUrl(aUrl.toString()) || URLUtil.isHttpsUrl(aUrl.toString())) &&
321322
(
322323
(SettingsStore.getInstance(getApplication()).getTrackingProtectionLevel() != ContentBlocking.EtpLevel.NONE) ||
323324
isPopUpAvailable.getValue().get() ||
@@ -332,8 +333,9 @@ public void onChanged(Spannable aUrl) {
332333
@Override
333334
public void onChanged(ObservableBoolean o) {
334335
isUrlBarIconsVisible.postValue(new ObservableBoolean(
335-
isLoading.getValue().get() ||
336-
isInsecureVisible.getValue().get()
336+
!isLibraryVisible.getValue().get() &&
337+
(isLoading.getValue().get() ||
338+
isInsecureVisible.getValue().get())
337339
));
338340
}
339341
};
@@ -389,10 +391,6 @@ public void setUrl(@Nullable Spannable url) {
389391

390392
String aURL = url.toString();
391393

392-
if (isLibraryVisible.getValue().get()) {
393-
return;
394-
}
395-
396394
int index = -1;
397395
try {
398396
aURL = URLDecoder.decode(aURL, "UTF-8");

0 commit comments

Comments
 (0)