Skip to content

Commit

Permalink
Closes mozilla-mobile#12692: Remove www. prefix in tab tray urls
Browse files Browse the repository at this point in the history
Use separate imports instead of a wildcard import

Use toShortUrl String extension instead of removing prefix from url host

Add missing import
  • Loading branch information
Antti Vainikka authored and ekager committed Jul 29, 2020
1 parent 048f6a4 commit 579a69b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import mozilla.components.feature.media.ext.playIfPaused
import mozilla.components.support.base.observer.Observable
import mozilla.components.support.images.ImageLoadRequest
import mozilla.components.support.images.loader.ImageLoader
import mozilla.components.support.ktx.kotlin.tryGetHostFromUrl
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
Expand All @@ -36,6 +35,7 @@ import org.mozilla.fenix.ext.increaseTapArea
import org.mozilla.fenix.ext.removeAndDisable
import org.mozilla.fenix.ext.removeTouchDelegate
import org.mozilla.fenix.ext.showAndEnable
import org.mozilla.fenix.ext.toShortUrl
import org.mozilla.fenix.utils.Do
import kotlin.math.max

Expand Down Expand Up @@ -160,7 +160,9 @@ class TabTrayViewHolder(
// is done in the toolbar and awesomebar:
// https://github.com/mozilla-mobile/fenix/issues/1824
// https://github.com/mozilla-mobile/android-components/issues/6985
urlView?.text = tab.url.tryGetHostFromUrl().take(MAX_URI_LENGTH)
urlView?.text = tab.url
.toShortUrl(itemView.context.components.publicSuffixList)
.take(MAX_URI_LENGTH)
}

@VisibleForTesting
Expand Down

0 comments on commit 579a69b

Please sign in to comment.