Implement a new API for overriding the user agent string

Bug #1410753 reported by Chris Coulson
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Oxide
Fix Released
Medium
Chris Coulson
webbrowser-app (Ubuntu)
Fix Released
Medium
Olivier Tilloy

Bug Description

Currently the browser provides user agent string overrides using WebContextDelegateWorker (intercepting onGetUserAgentOverride for accesses to navigator.userAgent and onBeforeSendHeaders for modifying the User-Agent header). However, it's only possible to access these and resolve the user agent string on the IO thread.

There is a requirement for being able to resolve the URL-specific user agent string when not on the IO thread (eg, mediahub), and this is not possible with the current design. As the browser's overrides appear to be a list of simple patterns (using "*" and "?"), there's no reason why we couldn't expose a new API (WebContext.userAgentOverrides) to allow the browser to specify the set of overrides. We would then do the matching inside of Oxide on whatever thread requires it using an API that is thread-safe internally, rather than calling in to an application provided script to do the pattern matching and determine the override.

This would mean that WebContext.userAgentOverrideDelegate would be deprecated (WebContext.networkRequestDelegate wouldn't be, as it has other uses besides setting the User-Agent header in HTTP requests).

Changed in oxide:
importance: Undecided → Medium
status: New → Triaged
description: updated
Changed in oxide:
milestone: none → branch-1.6
Changed in oxide:
assignee: nobody → Chris Coulson (chrisccoulson)
Changed in oxide:
milestone: branch-1.6 → branch-1.7
Changed in oxide:
milestone: branch-1.7 → branch-1.8
Changed in oxide:
milestone: branch-1.8 → branch-1.9
Changed in oxide:
status: Triaged → In Progress
Changed in oxide:
status: In Progress → Fix Released
Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → Medium
status: New → Triaged
Olivier Tilloy (osomon)
Changed in webbrowser-app (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webbrowser-app - 0.23+15.10.20150913-0ubuntu1

---------------
webbrowser-app (0.23+15.10.20150913-0ubuntu1) wily; urgency=medium

  [ CI Train Bot ]
  * New rebuild forced.
  * Resync trunk. added: po/mr.po

  [ Olivier Tilloy ]
  * Allow saving canvas images from the context menu.
  * Handle HTTP authentication requests by showing an authentication
    dialog. (LP: #1422534)
  * Remove the workaround for bug #1471181 now that oxide 1.9 has been
    released with a proper fix. (LP: #1471181)
  * Set the 'visible' property of actions instead of 'enabled' to ensure
    the visibility of the corresponding entries in the drawer menu
    matches. (LP: #1495297)
  * Use SIGABRT instead of SIGSEGV to crash a renderer process in tests.
    (LP: #1493825)
  * Use the new WebContext.userAgentOverrides API (new in Oxide 1.9).
    (LP: #1410753)

  [ Ugo Riboni ]
  * Handle HTTP authentication requests by showing an authentication
    dialog. (LP: #1422534)

 -- Olivier Tilloy <email address hidden> Sun, 13 Sep 2015 21:25:02 +0000

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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