[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][base-browser-128.2.0esr-14.0-1] 2 commits: fixup! Firefox preference overrides.



Title: GitLab

Pier Angelo Vendrame pushed to branch base-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser

Commits:

  • bed52c3f
    by Dan Ballard at 2024-09-12T21:07:53+02:00
    fixup! Firefox preference overrides.
    
    Bug 43046: Disable emailTrackingBlocking in pbm
    
  • 379a2960
    by cypherpunks1 at 2024-09-12T21:08:09+02:00
    fixup! Bug 40925: Implemented the Security Level component
    
    Bug 43128: Use DuckDuckGo HTML on the Safest security level for Android
    

5 changed files:

Changes:

  • browser/app/profile/001-base-profile.js
    ... ... @@ -242,6 +242,7 @@ pref("privacy.donottrackheader.enabled", false); // (mullvad-browser#17)
    242 242
     // Make sure there is no Tracking Protection active in Tor Browser, see: #17898.
    
    243 243
     pref("privacy.trackingprotection.enabled", false);
    
    244 244
     pref("privacy.trackingprotection.pbmode.enabled", false);
    
    245
    +pref("privacy.trackingprotection.emailtracking.pbmode.enabled", false);
    
    245 246
     pref("privacy.trackingprotection.annotate_channels", false);
    
    246 247
     pref("privacy.trackingprotection.cryptomining.enabled", false);
    
    247 248
     pref("privacy.trackingprotection.fingerprinting.enabled", false);
    

  • mobile/android/android-components/components/feature/search/src/main/java/mozilla/components/feature/search/SearchUseCases.kt
    ... ... @@ -13,6 +13,8 @@ import mozilla.components.browser.state.state.SessionState
    13 13
     import mozilla.components.browser.state.state.selectedOrDefaultSearchEngine
    
    14 14
     import mozilla.components.browser.state.store.BrowserStore
    
    15 15
     import mozilla.components.concept.engine.EngineSession
    
    16
    +import mozilla.components.concept.engine.Settings
    
    17
    +import mozilla.components.concept.engine.UnsupportedSettingException
    
    16 18
     import mozilla.components.feature.search.ext.buildSearchUrl
    
    17 19
     import mozilla.components.feature.session.SessionUseCases
    
    18 20
     import mozilla.components.feature.tabs.TabsUseCases
    
    ... ... @@ -25,6 +27,7 @@ class SearchUseCases(
    25 27
         store: BrowserStore,
    
    26 28
         tabsUseCases: TabsUseCases,
    
    27 29
         sessionUseCases: SessionUseCases,
    
    30
    +    settings: Settings? = null,
    
    28 31
     ) {
    
    29 32
         interface SearchUseCase {
    
    30 33
             /**
    
    ... ... @@ -41,6 +44,7 @@ class SearchUseCases(
    41 44
             private val store: BrowserStore,
    
    42 45
             private val tabsUseCases: TabsUseCases,
    
    43 46
             private val sessionUseCases: SessionUseCases,
    
    47
    +        private val settings: Settings? = null,
    
    44 48
         ) : SearchUseCase {
    
    45 49
             private val logger = Logger("DefaultSearchUseCase")
    
    46 50
     
    
    ... ... @@ -72,9 +76,15 @@ class SearchUseCases(
    72 76
                 flags: EngineSession.LoadUrlFlags = EngineSession.LoadUrlFlags.none(),
    
    73 77
                 additionalHeaders: Map<String, String>? = null,
    
    74 78
             ) {
    
    79
    +            var securityLevel: Int
    
    80
    +            try {
    
    81
    +                securityLevel = settings?.torSecurityLevel ?: 0
    
    82
    +            } catch (e: UnsupportedSettingException) {
    
    83
    +                securityLevel = 0
    
    84
    +            }
    
    75 85
                 val searchUrl = searchEngine?.let {
    
    76
    -                searchEngine.buildSearchUrl(searchTerms)
    
    77
    -            } ?: store.state.search.selectedOrDefaultSearchEngine?.buildSearchUrl(searchTerms)
    
    86
    +                searchEngine.buildSearchUrl(searchTerms, securityLevel)
    
    87
    +            } ?: store.state.search.selectedOrDefaultSearchEngine?.buildSearchUrl(searchTerms, securityLevel)
    
    78 88
     
    
    79 89
                 if (searchUrl == null) {
    
    80 90
                     logger.warn("No default search engine available to perform search")
    
    ... ... @@ -124,6 +134,7 @@ class SearchUseCases(
    124 134
             private val store: BrowserStore,
    
    125 135
             private val tabsUseCases: TabsUseCases,
    
    126 136
             private val isPrivate: Boolean,
    
    137
    +        private val settings: Settings? = null,
    
    127 138
         ) : SearchUseCase {
    
    128 139
             private val logger = Logger("NewTabSearchUseCase")
    
    129 140
     
    
    ... ... @@ -161,9 +172,15 @@ class SearchUseCases(
    161 172
                 flags: EngineSession.LoadUrlFlags = EngineSession.LoadUrlFlags.none(),
    
    162 173
                 additionalHeaders: Map<String, String>? = null,
    
    163 174
             ) {
    
    175
    +            var securityLevel: Int
    
    176
    +            try {
    
    177
    +                securityLevel = settings?.torSecurityLevel ?: 0
    
    178
    +            } catch (e: UnsupportedSettingException) {
    
    179
    +                securityLevel = 0
    
    180
    +            }
    
    164 181
                 val searchUrl = searchEngine?.let {
    
    165
    -                searchEngine.buildSearchUrl(searchTerms)
    
    166
    -            } ?: store.state.search.selectedOrDefaultSearchEngine?.buildSearchUrl(searchTerms)
    
    182
    +                searchEngine.buildSearchUrl(searchTerms, securityLevel)
    
    183
    +            } ?: store.state.search.selectedOrDefaultSearchEngine?.buildSearchUrl(searchTerms, securityLevel)
    
    167 184
     
    
    168 185
                 if (searchUrl == null) {
    
    169 186
                     logger.warn("No default search engine available to perform search")
    
    ... ... @@ -310,15 +327,15 @@ class SearchUseCases(
    310 327
         }
    
    311 328
     
    
    312 329
         val defaultSearch: DefaultSearchUseCase by lazy {
    
    313
    -        DefaultSearchUseCase(store, tabsUseCases, sessionUseCases)
    
    330
    +        DefaultSearchUseCase(store, tabsUseCases, sessionUseCases, settings)
    
    314 331
         }
    
    315 332
     
    
    316 333
         val newTabSearch: NewTabSearchUseCase by lazy {
    
    317
    -        NewTabSearchUseCase(store, tabsUseCases, false)
    
    334
    +        NewTabSearchUseCase(store, tabsUseCases, false, settings)
    
    318 335
         }
    
    319 336
     
    
    320 337
         val newPrivateTabSearch: NewTabSearchUseCase by lazy {
    
    321
    -        NewTabSearchUseCase(store, tabsUseCases, true)
    
    338
    +        NewTabSearchUseCase(store, tabsUseCases, true, settings)
    
    322 339
         }
    
    323 340
     
    
    324 341
         val addSearchEngine: AddNewSearchEngineUseCase by lazy {
    

  • mobile/android/android-components/components/feature/search/src/main/java/mozilla/components/feature/search/ext/SearchEngine.kt
    ... ... @@ -85,9 +85,9 @@ fun SearchEngine.buildSuggestionsURL(query: String): String? {
    85 85
     /**
    
    86 86
      * Builds a URL to search for the given search terms with this search engine.
    
    87 87
      */
    
    88
    -fun SearchEngine.buildSearchUrl(searchTerm: String): String {
    
    88
    +fun SearchEngine.buildSearchUrl(searchTerm: String, securityLevel: Int = 0): String {
    
    89 89
         val builder = SearchUrlBuilder(this)
    
    90
    -    return builder.buildSearchUrl(searchTerm)
    
    90
    +    return builder.buildSearchUrl(searchTerm, securityLevel)
    
    91 91
     }
    
    92 92
     
    
    93 93
     /**
    

  • mobile/android/android-components/components/feature/search/src/main/java/mozilla/components/feature/search/internal/SearchUrlBuilder.kt
    ... ... @@ -28,9 +28,12 @@ private const val OS_PARAM_OPTIONAL = "\\{" + "(?:\\w+:)?\\w+?" + "\\}"
    28 28
     internal class SearchUrlBuilder(
    
    29 29
         private val searchEngine: SearchEngine,
    
    30 30
     ) {
    
    31
    -    fun buildSearchUrl(searchTerms: String): String {
    
    31
    +    fun buildSearchUrl(searchTerms: String, securityLevel: Int): String {
    
    32 32
             // The parser should have put the best URL for this device at the beginning of the list.
    
    33
    -        val template = searchEngine.resultUrls[0]
    
    33
    +        var template = searchEngine.resultUrls[0]
    
    34
    +        if (securityLevel == 1 && (searchEngine.id == "ddg" || searchEngine.id == "ddg-onion")) {
    
    35
    +            template = template.replaceFirst("/?", "/html/?")
    
    36
    +        }
    
    34 37
             return buildUrl(template, searchTerms)
    
    35 38
         }
    
    36 39
     
    

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/UseCases.kt
    ... ... @@ -73,6 +73,7 @@ class UseCases(
    73 73
                 store,
    
    74 74
                 tabsUseCases,
    
    75 75
                 sessionUseCases,
    
    76
    +            engine.settings,
    
    76 77
             )
    
    77 78
         }
    
    78 79
     
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits