2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/24331 - Support for opening new tabs when requested by service workers

Use the new `ServiceWorkerSupport` AC components for this.
Had to be installed in `FenixApplication` since there is a circular dependency
between the initialization of the required engine the `tabsUseCases` arguments.
This commit is contained in:
Mugurell 2022-03-30 18:49:51 +03:00 committed by mergify[bot]
parent e64ab5f219
commit e35120f075
3 changed files with 9 additions and 2 deletions

View File

@ -504,8 +504,9 @@ dependencies {
implementation Deps.mozilla_feature_webcompat implementation Deps.mozilla_feature_webcompat
implementation Deps.mozilla_feature_webnotifications implementation Deps.mozilla_feature_webnotifications
implementation Deps.mozilla_feature_webcompat_reporter implementation Deps.mozilla_feature_webcompat_reporter
implementation Deps.mozilla_service_pocket implementation Deps.mozilla_feature_serviceworker
implementation Deps.mozilla_service_pocket
implementation Deps.mozilla_service_contile implementation Deps.mozilla_service_contile
implementation Deps.mozilla_service_digitalassetlinks implementation Deps.mozilla_service_digitalassetlinks
implementation Deps.mozilla_service_sync_autofill implementation Deps.mozilla_service_sync_autofill

View File

@ -36,6 +36,7 @@ import mozilla.components.feature.addons.update.GlobalAddonDependencyProvider
import mozilla.components.feature.autofill.AutofillUseCases import mozilla.components.feature.autofill.AutofillUseCases
import mozilla.components.feature.search.ext.buildSearchUrl import mozilla.components.feature.search.ext.buildSearchUrl
import mozilla.components.feature.search.ext.waitForSelectedOrDefaultSearchEngine import mozilla.components.feature.search.ext.waitForSelectedOrDefaultSearchEngine
import mozilla.components.feature.serviceworker.ServiceWorkerSupport
import mozilla.components.feature.top.sites.TopSitesProviderConfig import mozilla.components.feature.top.sites.TopSitesProviderConfig
import mozilla.components.lib.crash.CrashReporter import mozilla.components.lib.crash.CrashReporter
import mozilla.components.service.fxa.manager.SyncEnginesStorage import mozilla.components.service.fxa.manager.SyncEnginesStorage
@ -200,6 +201,10 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
setupLeakCanary() setupLeakCanary()
startMetricsIfEnabled() startMetricsIfEnabled()
ServiceWorkerSupport.install(
components.core.engine,
components.useCases.tabsUseCases.addTab
)
setupPush() setupPush()
visibilityLifecycleCallback = VisibilityLifecycleCallback(getSystemService()) visibilityLifecycleCallback = VisibilityLifecycleCallback(getSystemService())

View File

@ -135,8 +135,9 @@ object Deps {
const val mozilla_feature_webcompat = "org.mozilla.components:feature-webcompat:${Versions.mozilla_android_components}" const val mozilla_feature_webcompat = "org.mozilla.components:feature-webcompat:${Versions.mozilla_android_components}"
const val mozilla_feature_webnotifications = "org.mozilla.components:feature-webnotifications:${Versions.mozilla_android_components}" const val mozilla_feature_webnotifications = "org.mozilla.components:feature-webnotifications:${Versions.mozilla_android_components}"
const val mozilla_feature_webcompat_reporter = "org.mozilla.components:feature-webcompat-reporter:${Versions.mozilla_android_components}" const val mozilla_feature_webcompat_reporter = "org.mozilla.components:feature-webcompat-reporter:${Versions.mozilla_android_components}"
const val mozilla_service_pocket = "org.mozilla.components:service-pocket:${Versions.mozilla_android_components}" const val mozilla_feature_serviceworker = "org.mozilla.components:feature-serviceworker:${Versions.mozilla_android_components}"
const val mozilla_service_pocket = "org.mozilla.components:service-pocket:${Versions.mozilla_android_components}"
const val mozilla_service_contile = const val mozilla_service_contile =
"org.mozilla.components:service-contile:${Versions.mozilla_android_components}" "org.mozilla.components:service-contile:${Versions.mozilla_android_components}"
const val mozilla_service_digitalassetlinks = const val mozilla_service_digitalassetlinks =