commit 45d278ab6d3ddcd788ccaa661064869c96500f68
parent a85ae22693619ad69f5ba370217e96afde744c0c
Author: hackademix <giorgio@maone.net>
Date: Wed, 4 Feb 2026 08:20:12 +0100
TB 44591: Force extensions initialization on startup.
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
@@ -30,6 +30,7 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
import mozilla.appservices.autofill.AutofillApiException
+import mozilla.components.browser.engine.gecko.GeckoEngine
import mozilla.components.browser.state.action.SystemAction
import mozilla.components.browser.state.selector.selectedTab
import mozilla.components.browser.state.store.BrowserStore
@@ -744,6 +745,20 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
components.useCases.tabsUseCases.selectTab(sessionId)
},
onExtensionsLoaded = { extensions ->
+
+ // temp fix for tb#44591 "fails to initialize WebExtensions"
+ // disable and enable each extension to properly initialize them
+ extensions.forEach { extension ->
+ if (extension.isEnabled()) {
+ (components.core.engine as GeckoEngine).disableWebExtension(
+ extension,
+ onSuccess = {
+ (components.core.engine as GeckoEngine).enableWebExtension(extension)
+ },
+ )
+ }
+ }
+
// Delay until bootstrap is finished so that it will actually update tor-browser#44303
components.torController.registerRunOnceBootstrapped(object : RunOnceBootstrapped {
override fun onBootstrapped() {