Commit 8cec9995 authored by MozLando's avatar MozLando
Browse files

Merge #4900



4900: Closes #4899: Sample browser crashes when using system engine r=Amejia481 a=csadilek

Similar to install our web extension features (readerview, icons, etc.), we just log and continue in this case.
Co-authored-by: default avatarChristian Sadilek <christian.sadilek@gmail.com>
parents 160b121d 99fba989
......@@ -9,6 +9,7 @@ import mozilla.components.browser.session.Session
import mozilla.components.support.base.facts.Facts
import mozilla.components.support.base.facts.processor.LogFactProcessor
import mozilla.components.support.base.log.Log
import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.base.log.sink.AndroidLogSink
import mozilla.components.support.ktx.android.content.isMainProcess
import mozilla.components.support.webextensions.WebExtensionSupport
......@@ -29,8 +30,17 @@ class SampleApplication : Application() {
components.engine.warmUp()
WebExtensionSupport.initialize(components.engine, components.store, onNewTabOverride = {
_, engineSession, url -> components.sessionManager.add(Session(url), true, engineSession)
})
try {
WebExtensionSupport.initialize(
components.engine,
components.store,
onNewTabOverride = {
_, engineSession, url -> components.sessionManager.add(Session(url), true, engineSession)
}
)
} catch (e: UnsupportedOperationException) {
// Web extension support is only available for engine gecko
Logger.error("Failed to initialize web extension support", e)
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment