Expose support for late-customization using `navigator.hasFeature()`

RESOLVED FIXED in Firefox 44

Status

Firefox OS
General
P1
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: ddurst, Assigned: _AtilA_)

Tracking

unspecified
FxOS-S10 (30Oct)
ARM
Gonk (Firefox OS)
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:2.5+, firefox44 fixed)

Details

(Whiteboard: systemsfe)

Attachments

(1 attachment, 3 obsolete attachments)

(Reporter)

Description

2 years ago
In looking at the late customization feature, we realized that on the consumer side the only way to limit it to 2.5+ was to use hasFeature("web-extensions") -- the methodology we're using to identify 2.5 via add-ons support -- but we determined that that's lousy. We don't want to infer a version from the support of something else.

Instead, we could just say if "late-customization" is supported. CCing sfoster, in case this would also change things on his side. Marking as P1 because of time-sensitivity.
What would constitute support? Perhaps the presence of a truthy value for the latecustomization.url mozSetting?
(Reporter)

Updated

2 years ago
Blocks: 1198031
I think that would be enough, yes. Most hasFeature() flags are hardcoded (the important point being that older devices don't have the hardcoded value and therefore don't return true)
(Assignee)

Comment 3

2 years ago
Created attachment 8677570 [details] [diff] [review]
A very simple approach, hardcoded check.

... this is like the previous web-extensions feature check but with the proper name, should be enough.
(Assignee)

Comment 4

2 years ago
Created attachment 8677591 [details] [diff] [review]
Expose late-customization feature
Assignee: nobody → jgomez
Attachment #8677570 - Attachment is obsolete: true
Attachment #8677591 - Flags: review?(overholt)
Attachment #8677570 - Flags: review?(ehsan)
Attachment #8677591 - Flags: review?(overholt) → review?(ehsan)

Comment 5

2 years ago
Comment on attachment 8677591 [details] [diff] [review]
Expose late-customization feature

This needs a test in test_hasFeature.html.

Also, please submit patches with 8 lines of context in the future.  Thanks!
Attachment #8677591 - Flags: review?(ehsan) → review-

Updated

2 years ago
Attachment #8677570 - Flags: review?(ehsan)
(Assignee)

Comment 6

2 years ago
Created attachment 8678816 [details] [diff] [review]
Add late-customization feature detection and unit test

Slightly modified the test to make easy add new future features.
Attachment #8677591 - Attachment is obsolete: true
Attachment #8678816 - Flags: review?(ehsan)
Comment on attachment 8678816 [details] [diff] [review]
Add late-customization feature detection and unit test

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

::: dom/base/test/test_hasFeature.html
@@ +64,5 @@
>    if (!b2gOnly) {
>      return Promise.resolve();
>    }
>  
> +  var builtInFeatures = [ 

nit: trailing whitespace.

@@ +66,5 @@
>    }
>  
> +  var builtInFeatures = [ 
> +    {feature: "web-extensions", value: true},
> +    {feature: "late-customization", value: true} 

here too

Comment 8

2 years ago
Comment on attachment 8678816 [details] [diff] [review]
Add late-customization feature detection and unit test

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

r=me with the trailing whitespaces fixed.
Attachment #8678816 - Flags: review?(ehsan) → review+
(Assignee)

Comment 9

2 years ago
Created attachment 8679182 [details] [diff] [review]
Add late-customization feature detection and unit test (v2)
Attachment #8678816 - Attachment is obsolete: true
Attachment #8679182 - Flags: review?(ehsan)
Comment on attachment 8679182 [details] [diff] [review]
Add late-customization feature detection and unit test (v2)

Whitespace corrected, carrying ehsan's r+
Attachment #8679182 - Flags: review?(ehsan) → review+

Updated

2 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/b2g-inbound/rev/080fb640f419
Keywords: checkin-needed
Whiteboard: systemsfe
blocking-b2g: --- → 2.5+

Comment 12

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/080fb640f419
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox44: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S10 (30Oct)

Updated

2 years ago
No longer blocks: 1198031

Updated

2 years ago
Blocks: 1219285
You need to log in before you can comment on or make changes to this bug.