Closed Bug 1195702 Opened 10 years ago Closed 10 years ago

Expose UDPSocket existence in navigator.hasFeature()

Categories

(Firefox OS Graveyard :: General, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: mat, Assigned: fabrice)

References

Details

Attachments

(1 file)

In bug 745283 UDPSocket was implemented and it's available to privileged apps [0]. Marketplace needs to separate devices with and without access to UDPSocket implementation, without requiring the permission itself. navigator.hasFeature() [1] is supposed to be used for that, but navigator.hasFeature('api.window.Navigator.UDPSocket') appears to be unimplemented. Could it be implemented for all versions of gecko that are shipping with that API ? I'm hesitant to allow apps using this API to be submitted to Marketplace without the ability for Marketplace to detect if the API works or not, since that means users on older versions would be able to see and install apps that are broken to them. [0] https://mxr.mozilla.org/mozilla-central/source/dom/apps/PermissionsTable.jsm#67 [1] https://dxr.mozilla.org/mozilla-central/source/dom/base/Navigator.cpp#1510
Blocks: 1195704
Priority: -- → P1
Assignee: nobody → fabrice
Attachment #8678390 - Flags: review?(ehsan)
Comment on attachment 8678390 [details] [diff] [review] hasfeature-udpsocket.patch Review of attachment 8678390 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/Navigator.cpp @@ +1695,5 @@ > p->MaybeResolve(true); > return p.forget(); > } > > + if (featureName.EqualsLiteral("Navigator.UDPSocket")) { This shouldn't be needed, see bug 1009645.
Attachment #8678390 - Flags: review?(ehsan) → review-
Mat, which versions did you test?
Ehhhh. We tested a few months ago on this. Looking at the isFeatureDetectible() code, it's entirely possible we didn't have the check correct. We'll double-check. I have a 2.1 and 2.5 handy that I can check now.
Indeed it's already working on 2.5 ; I just had the wrong string, because I was expecting it to be similar to TCPSocket :( <<< navigator.hasFeature('api.window.UDPSocket').then(function(val) { console.log(val); }); >>> true
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: