Verified Commit 2b6f6d20 authored by ma1's avatar ma1
Browse files

fixup! [android] Modify add-on support

TB 44533: Install bundled NoScript extension at least once per build install
parent bd9b3c0d
Loading
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -115,15 +115,19 @@ object TorBrowserFeatures {
            )
        }
        /**
         *  Install NoScript as a user WebExtension if we have not already done so.
         *  Install NoScript if we have not done it yet for this browser version.
         *  AMO signature is checked, but automatic updates still need to be enabled.
         */
        if (!settings.noscriptInstalled) {
        val extensionsVersion =
            org.mozilla.geckoview.BuildConfig.MOZ_APP_VERSION + "-" +
            org.mozilla.geckoview.BuildConfig.MOZ_APP_BUILDID + "-" +
            org.mozilla.fenix.BuildConfig.VCS_HASH
        if (settings.extensionsVersion != extensionsVersion) {
            installNoScript(
                context,
                runtime,
                onSuccess = {
                    settings.noscriptInstalled = true
                    settings.extensionsVersion = extensionsVersion
                    logger.debug("NoScript extension was installed successfully")
                },
                onError = { throwable ->
+3 −8
Original line number Diff line number Diff line
@@ -2151,14 +2151,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
        default = false,
    )

    var noscriptInstalled by booleanPreference(
        appContext.getPreferenceKey(R.string.pref_key_noscript_installed),
        default = false
    )

    var noscriptUpdated by intPreference(
        appContext.getPreferenceKey(R.string.pref_key_noscript_updated),
        default = 0
    var extensionsVersion by stringPreference(
        appContext.getPreferenceKey(R.string.pref_key_extensions_version),
        default = ""
    )

    var httpsEverywhereRemoved by booleanPreference(
+1 −2
Original line number Diff line number Diff line
@@ -475,8 +475,7 @@
    <string name="pref_key_setup_step_theme" translatable="false">pref_key_setup_step_theme</string>
    <string name="pref_key_setup_step_extensions" translatable="false">pref_key_setup_step_extensions</string>

    <string name="pref_key_noscript_installed" translatable="false">pref_key_noscript_installed</string>
    <string name="pref_key_noscript_updated" translatable="false">pref_key_noscript_updated</string>
    <string name="pref_key_extensions_version" translatable="false">pref_key_extensions_version</string>
    <string name="pref_key_https_everywhere_removed" translatable="false">pref_key_https_everywhere_removed</string>

    <!-- Security Level Settings -->