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

ma1 (@ma1) git at gitlab.torproject.org
Mon Jan 8 18:55:24 UTC 2024



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:

- 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/cb98e7b217abdf3c675856a7bbb0386748bfb987

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/cb98e7b217abdf3c675856a7bbb0386748bfb987
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/20240108/9d0643a6/attachment-0001.htm>


More information about the tbb-commits mailing list