tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit deac8c7da7d2f66b18f20a95b12a0e867185ca7d
parent bdecb87aef9e0d05c26cb581c2f312f5b5158df3
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date:   Sat,  1 Nov 2025 00:30:34 +0000

Bug 1992035 - Update default top sites for JP region r=android-reviewers,skhan

- Bundle the favicon image URL to be loaded for the JP listed default top sites.

Differential Revision: https://phabricator.services.mozilla.com/D267523

Diffstat:
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSites.kt | 13+++++++++++--
Mmobile/android/fenix/app/src/main/res/raw/initial_shortcuts.json | 67++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 77 insertions(+), 3 deletions(-)

diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSites.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSites.kt @@ -435,15 +435,24 @@ private fun TopSiteFaviconCard( shape = RoundedCornerShape(4.dp), ) { if (topSite is TopSite.Provided) { - TopSiteFavicon(topSite.url, topSite.imageUrl) + TopSiteFavicon(url = topSite.url, imageUrl = topSite.imageUrl) } else { - TopSiteFavicon(topSite.url) + TopSiteFavicon(url = topSite.url, imageUrl = getImageUrl(url = topSite.url)) } } } } } +private fun getImageUrl(url: String): String? { + return when (url) { + "https://tenki.jp/" -> "https://tenki.jp/favicon.ico" + "https://m.yahoo.co.jp/" -> "https://s.yimg.jp/c/icon/s/bsc/2.0/favicon.ico" + "https://ameblo.jp/" -> "https://stat100.ameba.jp/common_style/img/favicon.ico" + else -> null + } +} + @Composable private fun TopSiteFavicon(url: String, imageUrl: String? = null) { Favicon(url = url, size = TOP_SITES_FAVICON_SIZE.dp, imageUrl = imageUrl) diff --git a/mobile/android/fenix/app/src/main/res/raw/initial_shortcuts.json b/mobile/android/fenix/app/src/main/res/raw/initial_shortcuts.json @@ -27,7 +27,8 @@ "schema": 1, "exclude_locales": [], "exclude_regions": [ - "CN" + "CN", + "JP" ], "include_locales": [], "include_regions": [], @@ -35,6 +36,70 @@ "include_experiments": [], "id": "", "last_modified": 1 + }, + { + "url": "https://tenki.jp/", + "order": 1, + "title": "tenki.jp", + "schema": 1, + "exclude_locales": [], + "exclude_regions": [], + "include_locales": [], + "include_regions": [ + "JP" + ], + "exclude_experiments": [], + "include_experiments": [], + "id": "", + "last_modified": 1 + }, + { + "url": "https://m.yahoo.co.jp/", + "order": 2, + "title": "Yahoo! JAPAN", + "schema": 1, + "exclude_locales": [], + "exclude_regions": [], + "include_locales": [], + "include_regions": [ + "JP" + ], + "exclude_experiments": [], + "include_experiments": [], + "id": "", + "last_modified": 1 + }, + { + "url": "https://ameblo.jp/", + "order": 3, + "title": "Amebaブログ", + "schema": 1, + "exclude_locales": [], + "exclude_regions": [], + "include_locales": [], + "include_regions": [ + "JP" + ], + "exclude_experiments": [], + "include_experiments": [], + "id": "", + "last_modified": 1 + }, + { + "url": "https://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8", + "order": 4, + "title": "ウィキペディア", + "schema": 1, + "exclude_locales": [], + "exclude_regions": [], + "include_locales": [], + "include_regions": [ + "JP" + ], + "exclude_experiments": [], + "include_experiments": [], + "id": "", + "last_modified": 1 } ] }