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


Commits:
be02ec86 by hackademix at 2023-12-30T19:51:11+01:00
fixup! Modify add-on support

Bug 42353: Fix NoScript automatic updates.

- - - - -


1 changed file:

- fenix/app/src/main/java/org/mozilla/fenix/components/TorBrowserFeatures.kt


Changes:

=====================================
fenix/app/src/main/java/org/mozilla/fenix/components/TorBrowserFeatures.kt
=====================================
@@ -136,37 +136,37 @@ object TorBrowserFeatures {
         }
 
         /**
-         *  If we have not done it yet, enable automatic updates for NoScript 
and force a
+         *  Enable automatic updates for NoScript and, if we've not done it 
yet, force a
          *  one-time immediate update check, in order to upgrade old profiles 
and ensure we've got
          *  the latest stable AMO version available on first startup.
          *  We will do it as soon as the Tor is connected, to prevent early 
addonUpdater activation
          *  causing automatic update checks failures (components.addonUpdater 
being a lazy prop).
          *  The extension, from then on, should behave as if the user had 
installed it manually.
          */
-        if (settings.noscriptUpdated == 0) {
-            context.components.torController.registerTorListener(object : 
TorEvents {
-                override fun onTorConnected() {
-                    
context.components.torController.unregisterTorListener(this)
-                    // Enable automatic updates
-                    
context.components.addonUpdater.registerForFutureUpdates(NOSCRIPT_ID)
-                    // Force an immediate update check
+        context.components.torController.registerTorListener(object : 
TorEvents {
+            override fun onTorConnected() {
+                context.components.torController.unregisterTorListener(this)
+                // Enable automatic updates. This must be done on every 
startup (tor-browser#42353)
+                
context.components.addonUpdater.registerForFutureUpdates(NOSCRIPT_ID)
+                // Force a one-time immediate update check for older 
installations
+                if (settings.noscriptUpdated < 2) {
                     context.components.addonUpdater.update(NOSCRIPT_ID)
-                    settings.noscriptUpdated = 1
+                    settings.noscriptUpdated = 2
                 }
+            }
 
-                @SuppressWarnings("EmptyFunctionBlock")
-                override fun onTorConnecting() {
-                }
+            @SuppressWarnings("EmptyFunctionBlock")
+            override fun onTorConnecting() {
+            }
 
-                @SuppressWarnings("EmptyFunctionBlock")
-                override fun onTorStopped() {
-                }
+            @SuppressWarnings("EmptyFunctionBlock")
+            override fun onTorStopped() {
+            }
 
-                @SuppressWarnings("EmptyFunctionBlock")
-                override fun onTorStatusUpdate(entry: String?, status: 
String?) {
-                }
-            })
-        }
+            @SuppressWarnings("EmptyFunctionBlock")
+            override fun onTorStatusUpdate(entry: String?, status: String?) {
+            }
+        })
     }
 
 



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/be02ec8601e43571da6c25a504f4633e54fd72e7

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/be02ec8601e43571da6c25a504f4633e54fd72e7
You're receiving this email because of your account on gitlab.torproject.org.


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

Reply via email to