Skip to content

Commit 12f76b6

Browse files
committed
Use the native New Tab as the default
1 parent e90262f commit 12f76b6

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

app/build.gradle

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ def isWebKitAvailable = {
104104
def GECKO_RELEASE_VERSION_NAME = '1.8.1'
105105
def CHROMIUM_RELEASE_VERSION_NAME = '1.2.1'
106106

107+
// Homepage and new tab URLs. HOMEPAGE_URL points at a website
108+
// and NEW_TAB_DEFAULT_URL determines the default content of a new tab.
109+
def localNewTabUrl = "about://newtab"
110+
def homepageDefaultUrl = "https://wolvic.com/start"
111+
def homepageChinaUrl = "https://wolvic.com/zh/start/index.html"
112+
def homepageChinaHvgUrl = "https://wolvic.com/zh/start/hvg.html"
113+
def homepageChinaPicoUrl = "https://wolvic.com/zh/start/pico.html"
114+
def homepageChinaPfdmUrl = "https://wolvic.com/zh/start/pfdm.html"
115+
107116
android {
108117
namespace 'com.igalia.wolvic'
109118
compileSdkVersion 35
@@ -131,7 +140,8 @@ android {
131140

132141
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
133142
resValue 'string', 'app_name', 'Wolvic'
134-
resValue 'string', 'HOMEPAGE_URL', "https://wolvic.com/start"
143+
resValue 'string', 'HOMEPAGE_URL', homepageDefaultUrl
144+
resValue 'string', 'NEW_TAB_DEFAULT_URL', localNewTabUrl
135145
externalNativeBuild {
136146
cmake {
137147
cppFlags "-std=c++14 -fexceptions -frtti -Werror" +
@@ -751,16 +761,20 @@ android.applicationVariants.configureEach { variant ->
751761
// HVR packages for mainland china must only use HVR speech recognition system.
752762
if (store == "mainlandChina") {
753763
if (platform.toLowerCase().startsWith('hvr')) {
754-
variant.resValue 'string', 'HOMEPAGE_URL', '"https://wolvic.com/zh/start/index.html"'
764+
variant.resValue 'string', 'HOMEPAGE_URL', homepageChinaUrl
765+
variant.resValue 'string', 'NEW_TAB_DEFAULT_URL', homepageChinaUrl
755766
variant.buildConfigField "String[]", "SPEECH_SERVICES", "{ com.igalia.wolvic.speech.SpeechServices.HUAWEI_ASR }"
756767
} else if (platform.toLowerCase().startsWith('visionglass')) {
757-
variant.resValue 'string', 'HOMEPAGE_URL', '"https://wolvic.com/zh/start/hvg.html"'
768+
variant.resValue 'string', 'HOMEPAGE_URL', homepageChinaHvgUrl
769+
variant.resValue 'string', 'NEW_TAB_DEFAULT_URL', homepageChinaHvgUrl
758770
variant.buildConfigField "String[]", "SPEECH_SERVICES", "{ com.igalia.wolvic.speech.SpeechServices.HUAWEI_ASR }"
759771
} else if (platform.toLowerCase().startsWith('picoxr')) {
760-
variant.resValue 'string', 'HOMEPAGE_URL', '"https://wolvic.com/zh/start/pico.html"'
772+
variant.resValue 'string', 'HOMEPAGE_URL', homepageChinaPicoUrl
773+
variant.resValue 'string', 'NEW_TAB_DEFAULT_URL', homepageChinaPicoUrl
761774
variant.buildConfigField "String[]", "SPEECH_SERVICES", "{ com.igalia.wolvic.speech.SpeechServices.MEETKAI }"
762775
} else if (platform.toLowerCase().startsWith('pfdmxr')) {
763-
variant.resValue 'string', 'HOMEPAGE_URL', '"https://wolvic.com/zh/start/pfdm.html"'
776+
variant.resValue 'string', 'HOMEPAGE_URL', homepageChinaPfdmUrl
777+
variant.resValue 'string', 'NEW_TAB_DEFAULT_URL', homepageChinaPfdmUrl
764778
variant.buildConfigField "String[]", "SPEECH_SERVICES", "{ com.igalia.wolvic.speech.SpeechServices.MEETKAI }"
765779
}
766780
}

app/src/common/shared/com/igalia/wolvic/browser/SettingsStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ public void setInputMode(int aTouchMode) {
527527
public String getHomepage() {
528528
return mPrefs.getString(
529529
mContext.getString(R.string.settings_key_homepage),
530-
mContext.getString(R.string.HOMEPAGE_URL));
530+
mContext.getString(R.string.NEW_TAB_DEFAULT_URL));
531531
}
532532

533533
public void setHomepage(String aHomepage) {

0 commit comments

Comments
 (0)