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

[tor-commits] [Git][tpo/applications/firefox-android][firefox-android-115.2.1-13.0-1] fixup! Modify add-on support



Title: GitLab

ma1 pushed to branch firefox-android-115.2.1-13.0-1 at The Tor Project / Applications / firefox-android

Commits:

  • cb98e7b2
    by hackademix at 2024-01-08T19:54:56+01:00
    fixup! Modify add-on support
    
    Bug 42353: Fix NoScript automatic updates.
    

1 changed file:

Changes:

  • fenix/app/src/main/java/org/mozilla/fenix/components/TorBrowserFeatures.kt
    ... ... @@ -136,37 +136,37 @@ object TorBrowserFeatures {
    136 136
             }
    
    137 137
     
    
    138 138
             /**
    
    139
    -         *  If we have not done it yet, enable automatic updates for NoScript and force a
    
    139
    +         *  Enable automatic updates for NoScript and, if we've not done it yet, force a
    
    140 140
              *  one-time immediate update check, in order to upgrade old profiles and ensure we've got
    
    141 141
              *  the latest stable AMO version available on first startup.
    
    142 142
              *  We will do it as soon as the Tor is connected, to prevent early addonUpdater activation
    
    143 143
              *  causing automatic update checks failures (components.addonUpdater being a lazy prop).
    
    144 144
              *  The extension, from then on, should behave as if the user had installed it manually.
    
    145 145
              */
    
    146
    -        if (settings.noscriptUpdated == 0) {
    
    147
    -            context.components.torController.registerTorListener(object : TorEvents {
    
    148
    -                override fun onTorConnected() {
    
    149
    -                    context.components.torController.unregisterTorListener(this)
    
    150
    -                    // Enable automatic updates
    
    151
    -                    context.components.addonUpdater.registerForFutureUpdates(NOSCRIPT_ID)
    
    152
    -                    // Force an immediate update check
    
    146
    +        context.components.torController.registerTorListener(object : TorEvents {
    
    147
    +            override fun onTorConnected() {
    
    148
    +                context.components.torController.unregisterTorListener(this)
    
    149
    +                // Enable automatic updates. This must be done on every startup (tor-browser#42353)
    
    150
    +                context.components.addonUpdater.registerForFutureUpdates(NOSCRIPT_ID)
    
    151
    +                // Force a one-time immediate update check for older installations
    
    152
    +                if (settings.noscriptUpdated < 2) {
    
    153 153
                         context.components.addonUpdater.update(NOSCRIPT_ID)
    
    154
    -                    settings.noscriptUpdated = 1
    
    154
    +                    settings.noscriptUpdated = 2
    
    155 155
                     }
    
    156
    +            }
    
    156 157
     
    
    157
    -                @SuppressWarnings("EmptyFunctionBlock")
    
    158
    -                override fun onTorConnecting() {
    
    159
    -                }
    
    158
    +            @SuppressWarnings("EmptyFunctionBlock")
    
    159
    +            override fun onTorConnecting() {
    
    160
    +            }
    
    160 161
     
    
    161
    -                @SuppressWarnings("EmptyFunctionBlock")
    
    162
    -                override fun onTorStopped() {
    
    163
    -                }
    
    162
    +            @SuppressWarnings("EmptyFunctionBlock")
    
    163
    +            override fun onTorStopped() {
    
    164
    +            }
    
    164 165
     
    
    165
    -                @SuppressWarnings("EmptyFunctionBlock")
    
    166
    -                override fun onTorStatusUpdate(entry: String?, status: String?) {
    
    167
    -                }
    
    168
    -            })
    
    169
    -        }
    
    166
    +            @SuppressWarnings("EmptyFunctionBlock")
    
    167
    +            override fun onTorStatusUpdate(entry: String?, status: String?) {
    
    168
    +            }
    
    169
    +        })
    
    170 170
         }
    
    171 171
     
    
    172 172
     
    

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