diff --git a/app/build.gradle b/app/build.gradle index 4ab1dff616..74899e88fb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -504,8 +504,9 @@ dependencies { implementation Deps.mozilla_feature_webcompat implementation Deps.mozilla_feature_webnotifications 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_digitalassetlinks implementation Deps.mozilla_service_sync_autofill diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 20312787e9..023530b0d1 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -36,6 +36,7 @@ import mozilla.components.feature.addons.update.GlobalAddonDependencyProvider import mozilla.components.feature.autofill.AutofillUseCases import mozilla.components.feature.search.ext.buildSearchUrl import mozilla.components.feature.search.ext.waitForSelectedOrDefaultSearchEngine +import mozilla.components.feature.serviceworker.ServiceWorkerSupport import mozilla.components.feature.top.sites.TopSitesProviderConfig import mozilla.components.lib.crash.CrashReporter import mozilla.components.service.fxa.manager.SyncEnginesStorage @@ -200,6 +201,10 @@ open class FenixApplication : LocaleAwareApplication(), Provider { setupLeakCanary() startMetricsIfEnabled() + ServiceWorkerSupport.install( + components.core.engine, + components.useCases.tabsUseCases.addTab + ) setupPush() visibilityLifecycleCallback = VisibilityLifecycleCallback(getSystemService()) diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 72386ba5df..03acdabe6f 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -135,8 +135,9 @@ object Deps { 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_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 = "org.mozilla.components:service-contile:${Versions.mozilla_android_components}" const val mozilla_service_digitalassetlinks =