Bug 1479311 - Don't attempt finding and highlighting a tab's base domain within a javascript: URL. r=snorp
authorJan Henning <jh+bugzilla@buttercookie.de>
Fri, 03 Aug 2018 20:58:46 +0200
changeset 430567 bf82b74a7db7fa6cc3987d1cdbf393a5c2e53e1e
parent 430566 84aff55a4fbfa9781f0b6df415a1fb3b867af798
child 430568 bf959a3fdcfc65fc282cac4b8375147fce6c9a33
push id34409
push usertoros@mozilla.com
push dateThu, 09 Aug 2018 10:00:05 +0000
treeherdermozilla-central@eb9ff7de69ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1479311
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1479311 - Don't attempt finding and highlighting a tab's base domain within a javascript: URL. r=snorp 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,