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

ma1 (@ma1) git at gitlab.torproject.org
Tue Jan 2 12:08:49 UTC 2024



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.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20240102/2a913328/attachment-0001.htm>


More information about the tbb-commits mailing list