← Back to team overview

ubuntu-webapps-bugs team mailing list archive

[Bug 1410753] [NEW] Implement a new API for overriding the user agent string

 

Public bug reported:

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).

** Affects: oxide
     Importance: Medium
         Status: Triaged

** Changed in: oxide
   Importance: Undecided => Medium

** Changed in: oxide
       Status: New => Triaged

** Description changed:

  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 Oxide on whatever thread requires it, using an API that
- is thread-safe internally
+ 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).

-- 
You received this bug notification because you are a member of Ubuntu
WebApps bug tracking, which is subscribed to Oxide.
https://bugs.launchpad.net/bugs/1410753

Title:
  Implement a new API for overriding the user agent string

Status in Oxide Webview:
  Triaged

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).

To manage notifications about this bug go to:
https://bugs.launchpad.net/oxide/+bug/1410753/+subscriptions


Follow ups

References