Android-components: YouTube doesn't load on SystemEngine unless a RequestInterceptor is added to it.

Created on 1 Oct 2018  路  2Comments  路  Source: mozilla-mobile/android-components

Tested this on the sample browser and found that on the current SystemEngine there, we don't have an interceptor on it and youtube is forever loading. Adding the SampleRequestInterceptor fixes this issue.

Doesn't work:

open class DefaultComponents(private val applicationContext: Context) {
    // Engine
    open val engine: Engine by lazy {
        SystemEngine()
    }
}

Works:

open class DefaultComponents(private val applicationContext: Context) {
    // Engine
    open val engine: Engine by lazy {
        val defaultSettings = DefaultSettings().apply {
            requestInterceptor = SampleRequestInterceptor()
        }
        SystemEngine(defaultSettings)
    }
}

I haven't yet investigated what is causing this. We did recently change our settings API so my first place to look would be there.

sample 馃悶 bug

Most helpful comment

@jonalmeida and I looked into this and found that this isn't related to the interceptor and isn't a (new) bug in settings either. It's caused by the sample app not setting javascriptEnabled = true. So, by adding DefaultSettings (e.g. the interceptor), we also enabled javascript (default is true), which is why this worked after adding an interceptor.

So, this issue can be closed. Also, after merging #931, this will just work as all default settings are then always applied.

All 2 comments

Interesting. I saw the same today and was wondering why I can't load YouTube.

@jonalmeida and I looked into this and found that this isn't related to the interceptor and isn't a (new) bug in settings either. It's caused by the sample app not setting javascriptEnabled = true. So, by adding DefaultSettings (e.g. the interceptor), we also enabled javascript (default is true), which is why this worked after adding an interceptor.

So, this issue can be closed. Also, after merging #931, this will just work as all default settings are then always applied.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mugurell picture Mugurell  路  5Comments

csadilek picture csadilek  路  3Comments

pocmo picture pocmo  路  6Comments

mitchhentges picture mitchhentges  路  5Comments

jonalmeida picture jonalmeida  路  4Comments