feat(client): Stringify WebChannel payloads in Fx Desktop >= 50. #4579
Conversation
| * Send a WebChannel message. | ||
| * | ||
| * @param {String} command command name | ||
| * @param {Objet} data payload |
vladikoff
Jan 3, 2017
Contributor
Objet -> Object
Objet -> Object
| */ | ||
| function formatEventDetail(win, eventDetail) { | ||
| const userAgent = new UserAgent(win.navigator.userAgent); | ||
| // Firefox Desktop >= 50 expects the detail to be sent as a string. |
vladikoff
Jan 3, 2017
Contributor
is it only FF Desktop or does this also apply to Fennec (Android)?
is it only FF Desktop or does this also apply to Fennec (Android)?
mhammond
Jan 4, 2017
Member
IIUC, Fennec uses the same WebChannel.jsm as desktop. What I don't know is what Fennec version it landed in :( I asked on #mobile and I'll let you know what response I get.
(and @thomcc ended up answering - it is 50 on Fennec too - see bug 1287884)
IIUC, Fennec uses the same WebChannel.jsm as desktop. What I don't know is what Fennec version it landed in :( I asked on #mobile and I'll let you know what response I get.
(and @thomcc ended up answering - it is 50 on Fennec too - see bug 1287884)
| * | ||
| * @param {String} webChannelId ID of the receiving WebChannel | ||
| * @param {String} command command name | ||
| * @param {Objet} data payload |
vladikoff
Jan 3, 2017
Contributor
Objet - > Object
Objet - > Object
| } | ||
|
|
||
| describe('send', function () { | ||
| describe('Fx Dekstop >= 50', () => { |
vladikoff
Jan 4, 2017
Contributor
Dekstop -> Desktop
Dekstop -> Desktop
|
This looks fine to me, notwithstanding the Fennec notes below (and the more general comment of either waiting a few months, or having a followup issue to remove the UA checks in a few months) |
| */ | ||
| function formatEventDetail(win, eventDetail) { | ||
| const userAgent = new UserAgent(win.navigator.userAgent); | ||
| // Firefox Desktop >= 50 expects the detail to be sent as a string. |
mhammond
Jan 4, 2017
Member
IIUC, Fennec uses the same WebChannel.jsm as desktop. What I don't know is what Fennec version it landed in :( I asked on #mobile and I'll let you know what response I get.
(and @thomcc ended up answering - it is 50 on Fennec too - see bug 1287884)
IIUC, Fennec uses the same WebChannel.jsm as desktop. What I don't know is what Fennec version it landed in :( I asked on #mobile and I'll let you know what response I get.
(and @thomcc ended up answering - it is 50 on Fennec too - see bug 1287884)
| // Firefox Desktop >= 50 expects the detail to be sent as a string. | ||
| // See https://bugzilla.mozilla.org/show_bug.cgi?id=1275616 and | ||
| // https://bugzilla.mozilla.org/show_bug.cgi?id=1238128 | ||
| if (userAgent.isFirefoxDesktop() && userAgent.browser.version >= 50) { |
mhammond
Jan 4, 2017
Member
As we mentioned in bugzilla, another alternative would be to just wait a few months and lose the UA check completely :)
As we mentioned in bugzilla, another alternative would be to just wait a few months and lose the UA check completely :)
|
This LGTM, and it sounds like we can remove the re: waiting a couple of months, I don't have high hopes that the long tail of users noted in [1] will age out with any great speed, so I'm fine with the sniffing approach in order to close this out. |
Fx Desktop >= 50 expects to see the `detail` property of WebChannel message payloads sent as strings. This makes it so. fixes #4577
267730b
to
c64a1de
c64a1de
to
2dc3f4e
…illa#4579) r=@mhammond, @rfk Fx Desktop & Fennec >= 50 expect to see the `detail` property of WebChannel message payloads sent as strings. This makes it so. fixes mozilla#4577
Fx Desktop >= 50 expects to see the
detailproperty of WebChannelmessage payloads sent as strings. This makes it so.
fixes #4577
@rfk, @mhammond - r?
@mhammond - I was unsure whether Fennec >= 50 has the same behavior, so I only send strings for Fx Desktop at the moment.