Compatibility/System Addon: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎TODO: format todo)
(Add Development section)
Line 73: Line 73:


* Possibly access/modify HTTP headers? (Unclear how useful this is, Karl is supposed to suggest a use case here.)
* Possibly access/modify HTTP headers? (Unclear how useful this is, Karl is supposed to suggest a use case here.)
== Development ==
Repo: https://github.com/mozilla/webcompat
Tracking bug: [https://bugzilla.mozilla.org/show_bug.cgi?id=1287966 Bug 1287966]


== TODO ==  
== TODO ==  

Revision as of 23:16, 19 July 2016

Introduction

The WebCompat Go Faster add-on proposes to provide a site patching mechanism for Firefox users. A site patch is defined as an origin- or path-scoped block of JavaScript that runs in the context of a web page.

By using the go faster system add-ons infrastructure and delivery mechanism, we can add and remove top web property site patches via out of band updates (i.e., not tied to the release train cadence). The intention is to provide a means to fix urgent issues until outreach efforts are successful, or until platform bugs or regressions are shipping in release builds as fixed.

Prior Art

Use Cases

  • A top site has a bug that affects Firefox users that can be worked around by modifying navigator.userAgent:
  • Firefox ships a regression in release breaking top sites
  • Working around widely deployed libraries or frameworks that don't support Firefox, have bugs, or make bad assumptions about Gecko, e.g., BrightCove and Ooyola serving HLS over .m3u8 to Firefox for Android on Android 4 (which is not supported) or greater but mp4 to Android 3 (which is supported).
  • Temporarily shim APIs that have been removed until top site is updated (e.g. showModalDialog).
  • A top site relies on a (mostly) shimmable non-standard API, e.g., window.event

Current solutions to use cases

Pros: simple; out of band CDN updates

Cons: only on Fennec, applies to all requests for a given domain, i.e., no conditional spoofing. simple regex tweaks only.

Pros: works.

Cons: has to ride trains. might require a dot release depending on the site and severity.

Pros: Get’s the job done.

Cons: Has to ride trains; Might require a dot release depending on the site and severity.

Requirements

  • Ability for developers to see that a site patch is enabled, with short explanation and link to bug (likely via developer console).
  • Ability to temporarily disable site patch for developers to test fixes.
  • Ability to modify page CSS
  • Ability to mutate page DOM
  • Ability to modify script (inline, external) source before execution
  • Ability for a site patch to target a specific URI rather than entire origin.
  • Ability to define setters and getters for page variables and methods (question for Hallvord: scope?)
  • Injected JS should not have chrome privileges
  • Injected JS should have full access to page
  • Site patches should not run if modified by user.
  • Possibly access/modify HTTP headers? (Unclear how useful this is, Karl is supposed to suggest a use case here.)

Development

Repo: https://github.com/mozilla/webcompat

Tracking bug: Bug 1287966

TODO

1. Define a policy for Site Patching.

2. Determine what is and isn't possible today via XPCOM; file bugs where needed

3. Develop infrastructure to validate if patches are still needed, or are still working (i.e., once a week)

4. Build a prototype for UA overrides

5. Intent to Implement (see https://docs.google.com/document/d/1x27I7hAmWDWiqk3o3YC3fklhE3N59bdgHCQHF5p_lkU/edit#heading=h.d5s8g8tyi5zs)