Epiphany doesn't mention Ubuntu in user agent string

Bug #332253 reported by Remco
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
epiphany-browser (Ubuntu)
Fix Released
Wishlist
Mike Pontillo

Bug Description

Binary package hint: epiphany-browser

The Wine project is trying to streamline their download page by detecting the distribution of visitors. However, Epiphany doesn't mention Ubuntu in the user agent string, so Epiphany users will get the non-streamlined download page.

Epiphany is using the useragent string
Mozilla/5.0 (X11; U; Linux x86_64; en; rv:1.9.0.6) Gecko/20080528 Epiphany/2.22 Firefox/3.0
but firefox puts the distro in between the Gecko and the browser name
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6"

It would be nice if Epiphany did the same.

See also http://www.winehq.org/pipermail/wine-devel/2009-February/073411.html

Ubuntu 8.10 x86-64
Epiphany 2.24.1

Changed in epiphany-browser:
importance: Undecided → Low
Dan Kegel (dank)
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

thank you for your bug report, that would be a nice task for a new contributor to work on

Changed in epiphany-browser:
assignee: nobody → desktop-bugs
importance: Low → Wishlist
status: New → Confirmed
Revision history for this message
Alexander Sack (asac) wrote :

the prefs you need to set are:

general.useragent.vendor=Ubuntu (get this from lsb_release -i)
general.useragent.vendorComment=jaunty (get this from lsb_release -c)
general.useragent.vendorSub=9.04 (get this from lsb_release -r)

Revision history for this message
Alexander Sack (asac) wrote :

e.g. put the prefs in /usr/share/epiphany-browser/default-prefs.js

Revision history for this message
Mike Pontillo (mpontillo) wrote :

I've never worked with Debian packages (other than with checkinstall) before, but would something like this do the trick?

The script depends on:
  echo
  mktemp
  lsb_release
  cut
  sed
  cat
  rm

It unconditionally replaces the default user-agent string every time the script is run.

I tested the script itself and it works for me. (user-agent came back as "Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.10) Gecko/20080528 Ubuntu/9.04 (jaunty) Epiphany/2.22 Firefox/3.0")

Changed in epiphany-browser (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → Mike Pontillo (mpontillo)
status: Confirmed → In Progress
Revision history for this message
Sebastien Bacher (seb128) wrote :

using postinst commands is the wrong way you can simply ship a .js with the pacakge or patch the source as debian is doing

Revision history for this message
Mike Pontillo (mpontillo) wrote :

I had a feeling that might be the case, but based on Alexander's suggestion above, I wasn't sure where the best place to modify the .js file would be.

If Debian already has this same fix in native code, then I agree, that's the way to go.

We could use the same script at the time of packaging rather than the time of installation. (But would 'lsb_release' always return the correct values when the .js file is being packaged? I assume there are other ways to get that data for the architecture the package is being generated for, but pre-determining it seems like more of a hack.)

We could use a similar postinst script to generate a separate .js file with the current lsb_release info, and modify the default default-prefs.js to comment out the lines that set the values to empty strings.

Revision history for this message
Sebastien Bacher (seb128) wrote :

there is probably no need to bother using lsb values, static versions should work or use those in the rules to build the .js at build time rather

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Okay, here's attempt #2.

This one integrates the script into the build process instead. I didn't do this at first, since I wasn't sure if whoever was building the package would always have the same /etc/lsb-release info as the target distribution.

Am I being too pedantic adding 'mktemp' and 'sed' to build-depends? I think the build scripts already used 'sed'. Maybe the dependency is buried elsewhere already. (lsb-release was already a dependency.)

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Modified patch to not require sed, or a helper script.

Revision history for this message
Alexander Sack (asac) wrote :

please use lsb_release -s -c for the general.useragent.vendorComment text.

besides from that its ok. Please include a changelog entry in your diff (aka full debdiff).

Revision history for this message
Mike Pontillo (mpontillo) wrote :

... and here's the debdiff. (with a small bug fix as well)

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Okay, I think I've really got it now. Better debdiff attached. Sorry for the spam.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package epiphany-browser - 2.26.1-0ubuntu2

---------------
epiphany-browser (2.26.1-0ubuntu2) karmic; urgency=low

  * Fix default prefs file to use info from lsb_release (LP: #332253)

 -- Mike Pontillo <email address hidden> Wed, 06 May 2009 15:30:31 -0700

Changed in epiphany-browser (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.