Commit a83ac1c4 authored by clairehurst's avatar clairehurst 🌱 Committed by Pier Angelo Vendrame
Browse files

fixup! TB 44591: Force extensions initialization on startup.

Revert "TB 44591: Force extensions initialization on startup."
This reverts commit bd2c6529.
parent 89a605a9
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import mozilla.appservices.autofill.AutofillApiException
import mozilla.components.ExperimentalAndroidComponentsApi
import mozilla.components.browser.engine.gecko.GeckoEngine
import mozilla.components.browser.state.action.SearchAction.SearchConfigurationAvailabilityChanged
import mozilla.components.browser.state.action.SystemAction
import mozilla.components.browser.state.selector.selectedTab
@@ -880,7 +879,6 @@ open class FenixApplication : Application(), Provider, ThemeProvider {
                    components.useCases.tabsUseCases.selectTab(sessionId)
                },
                onExtensionsLoaded = { extensions ->

                    // enable noscript if it is disabled
                    extensions.find { extension : WebExtension ->
                        extension.id == NOSCRIPT_ID
@@ -890,19 +888,6 @@ open class FenixApplication : Application(), Provider, ThemeProvider {
                        }
                    }

                    // 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() {