Open Bug 1775492 Opened 3 years ago Updated 1 years ago

Add a region pref for "Recommended by Pocket" on new tab page

Categories

(Firefox :: Pocket, task)

task

Tracking

()

People

(Reporter: saschanaz, Assigned: thecount)

Details

(Whiteboard: [hnteng])

Attachments

(1 file)

My understanding is that we are not ready for full customization, but that it's still okay to have a pref to prepare that. Ping me if I'm wrong.

Summary: Add a region pref for "Recommended by Pocket" → Add a region pref for "Recommended by Pocket" on new tab page

I agree with this, and I'll see if I can find some time to do this if no one wants it.

For what it's worth it is currently possible to flip prefs and do something similar, but it's a bit cumbersome changing multiple prefs, and it needs to change your region pref which is used by other features and might have other unwanted side effects.

We currently have 4 available feeds, US, GB, DE, and IN. DE is the only non English feed.

To do this we need to make 2 main changes.

The first is to change the way newtab decides if Pocket stories should be displayed or not.
The second is once the first is true, we need to decide what region of content we need to display. https://searchfox.org/mozilla-central/source/browser/components/newtab/lib/DiscoveryStreamFeed.jsm#336-337

For the first part I think we just need to return true in this function, if the new pref has a value we support, probably right after the !geo check. Rest of the function can probably be ignored.

Second part is for these lines pass in the new value(s) that make sense based on the pref value. If the pref is not defined, we need to use the current values. These values area bit tricky, because the server translates region and locale combinations into a feed, which we need to produce the desired feed with the proper override from a single pref. So in the case of DE override pref, we want to make sure locale and region passed in are DE, that is pretty straight forward. To get US, GB or IN, first we pass in that region, then we need to make sure the locale passed is an English Locale from one of these en-US, en-GB, or en-CA. So to calculate the locale, we probably want a simplified map similar to this.

Assignee: nobody → sdowne
Whiteboard: [hnteng]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: