Bug 1479311 - Don't attempt finding and highlighting a tab's base domain within a javascript: URL. r=snorp a=lizzard
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 03 Aug 2018 20:58:46 +0200
changeset 478433 7456a854852b074f61d83f9bfd9285a22c29a053
parent 478432 8c9fa6f809a8ccce4cc34f9283ce97aaae7e3e29
child 478434 486daac9c70709ae9f36b9af8d0992912fe29746
push id9666
push usercbrindusan@mozilla.com
push dateWed, 15 Aug 2018 10:01:01 +0000
treeherdermozilla-beta@486daac9c707 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, lizzard
bugs1479311
milestone62.0
Bug 1479311 - Don't attempt finding and highlighting a tab's base domain within a javascript: URL. r=snorp a=lizzard MozReview-Commit-ID: DzE0UJfMcCI
mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
--- a/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
@@ -330,17 +330,17 @@ public class ToolbarDisplayLayout extend
 
     private void updateAndColorTitleFromFullURL(String url, String baseDomain, boolean isPrivate) {
         if (TextUtils.isEmpty(baseDomain)) {
             setTitle(url);
             return;
         }
 
         int index = url.indexOf(baseDomain);
-        if (index == -1) {
+        if (index == -1 || url.startsWith("javascript:")) {
             setTitle(url);
             return;
         }
 
         final SpannableStringBuilder builder = new SpannableStringBuilder(url);
 
         builder.setSpan(isPrivate ? mPrivateUrlColorSpan : mUrlColorSpan, 0, url.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
         builder.setSpan(isPrivate ? mPrivateDomainColorSpan : mDomainColorSpan,