mozilla-mobile / firefox-tv

Firefox for Amazon's Fire TV
https://blog.mozilla.org/blog/2017/12/20/firefox-is-now-on-amazon-fire-tv-happy-holiday-watching/
Mozilla Public License 2.0
257 stars 111 forks source link

Make User Agent reflect GeckoView in `gecko` configuration #1879

Open ncalexan opened 5 years ago

ncalexan commented 5 years ago

Steps to reproduce

In system and gecko configurations, observe navigator.userAgent in content.

Expected behavior

navigator.userAgent should vary between system and gecko configurations.

Actual behavior

navigator.userAgent is constant across system and gecko configurations.

Device information

ncalexan commented 5 years ago

My use case is running browsertime against Firefox TV, and I can't distinguish my system WebView runs from my GeckoView runs.

devinreams commented 5 years ago

@cpeterso @ncalexan we couldn't quite tell, does this block your progress and development?

ncalexan commented 5 years ago

@cpeterso @ncalexan we couldn't quite tell, does this block your progress and development?

No. I've applied a trivial patch locally and I have other ways to determine this. The logic is non-trivial (very!) but very helpful so I'd like it to get done for the GeckoView version sooner rather than later.

cpeterso commented 5 years ago

mozilla-mobile/android-components#1018 just landed a fix so A-C will read GV's default User-Agent string. Would updating FFTV's A-C version fix this issue?

ncalexan commented 5 years ago

mozilla-mobile/android-components#1018 just landed a fix so A-C will read GV's default User-Agent string. Would updating FFTV's A-C version fix this issue?

Not immediately because FFTV does pretty wild things: https://github.com/mozilla-mobile/firefox-tv/blob/f2d1ab1bacc7dae1339da5a8479cea1eb48384bd/app/src/gecko/java/org/mozilla/tv/firefox/webrender/WebRenderComponents.kt#L23. Stop doing that (and passing it through) and FFTV will take GV's string, which may or may not be the desired outcome.

ncalexan commented 5 years ago

@athomasmoz and I talked about this, and conclude that we're not going to do this until we can make Firefox TV's User Agent agree with a more mainline browser's User Agent. That is, we might make this match Firefox for Android (or a successor) but we won't risk User Agent-based blocking in the interim.