Closed Bug 885582 Opened 11 years ago Closed 11 years ago

Append version number to about:healthreport URL

Categories

(Firefox Health Report Graveyard :: Client: Android, defect)

All
Android
defect
Not set
normal

Tracking

(firefox23 fixed)

RESOLVED FIXED
Firefox 24
Tracking Status
firefox23 --- fixed

People

(Reporter: nalexander, Assigned: nalexander)

References

Details

Attachments

(1 file)

rnewman and I were talking, and we'd like to version the mobile about:healthreport wrapper.  The idea would be to request /mobile/1 for version 1 (or /mobile/?version=1) to allow the about:healthreport wrapper to grow capabilities.  That is, this will let us advertise what messages the wrapper understands from the content.

The first set of capabilities will likely be showing the data reporting settings (Bug 879555) and launching an updater (Bug 882745).

Let's make this ticket the content ticket; after discussion, I'll open the Android client ticket.
Tested against no trailing slash, trailing slash, and included query
parameter:

    328:E GeckoConsole(20202)         uri.spec: https://fhr.cdn.mozilla.net/en-US?v=1
    427:E GeckoConsole(20202)         uri.spec: https://fhr.cdn.mozilla.net/en-US/mobile/?v=1
    468:E GeckoConsole(20202)         uri.spec: https://fhr.cdn.mozilla.net/en-US/mobile/?x=y&v=1
Attachment #766128 - Flags: review?(rnewman)
Comment on attachment 766128 [details] [diff] [review]
Append version number query parameter to Android about:healthreport URL. r=rnewman

Review of attachment 766128 [details] [diff] [review]:
-----------------------------------------------------------------

Approval request: we would like the FHR page URL to have a version parameter, so we can update the capabilities of the wrapper without confusing the web content. This tiny patch does so.

::: mobile/android/chrome/content/aboutHealthReport.js
@@ +60,5 @@
>  
>    _getReportURI: function () {
>      let url = Services.urlFormatter.formatURLPref(PREF_REPORTURL);
> +    // This handles URLs that already have query parameters.
> +    let uri = Services.io.newURI(url, null, null).QueryInterface(Ci.nsIURL);

This kinda rings my "should have a try block" bell, but if anyone does something stupid like jams a mailto: URI into the report URL pref, they deserve what they get.

@@ +64,5 @@
> +    let uri = Services.io.newURI(url, null, null).QueryInterface(Ci.nsIURL);
> +    if (uri.query != "") {
> +      uri.query += "&";
> +    }
> +    uri.query += "v=" + WRAPPER_VERSION;

Every little helps: avoid a concatenation.

  uri.query += ((uri.query != "") ? "&v=" : "v=") + WRAPPER_VERSION;
Attachment #766128 - Flags: review?(rnewman)
Attachment #766128 - Flags: review+
Attachment #766128 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/services/services-central/rev/ec25f53bf993
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Whiteboard: [fixed in services]
Target Milestone: --- → Firefox 24
I stole this one for the Android Client.  Webdev can open another as and when they see fit.
Component: Web: Health Report → Client: Android
https://hg.mozilla.org/mozilla-central/rev/ec25f53bf993
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services]
Comment on attachment 766128 [details] [diff] [review]
Append version number query parameter to Android about:healthreport URL. r=rnewman

[Triage Comment]

Switching the aurora nom to beta and approving as this is needed for Fx23 beta 1 and confirmed its low risk.
Attachment #766128 - Flags: approval-mozilla-aurora? → approval-mozilla-beta+
Product: Firefox Health Report → Firefox Health Report Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: