[meta] Convert builtin opensearch files to webextensions
Categories
(WebExtensions :: General, enhancement, P2)
Tracking
(firefox68 fixed)
| Tracking | Status | |
|---|---|---|
| firefox68 | --- | fixed |
People
(Reporter: mixedpuppy, Assigned: daleharvey)
References
(Depends on 1 open bug, )
Details
(Keywords: meta)
Attachments
(4 files, 3 obsolete files)
| Reporter | ||
Comment 1•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
| Assignee | ||
Comment 4•7 years ago
|
||
| Reporter | ||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
| Reporter | ||
Comment 7•7 years ago
|
||
| Reporter | ||
Updated•7 years ago
|
| Assignee | ||
Comment 8•7 years ago
|
||
| Reporter | ||
Comment 9•7 years ago
|
||
| Assignee | ||
Comment 10•7 years ago
|
||
| Assignee | ||
Comment 11•7 years ago
|
||
| Reporter | ||
Comment 12•7 years ago
|
||
| Reporter | ||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
| Reporter | ||
Comment 15•7 years ago
|
||
| Reporter | ||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
| Reporter | ||
Comment 18•7 years ago
|
||
| Assignee | ||
Comment 19•7 years ago
|
||
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 20•6 years ago
|
||
| Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
| Assignee | ||
Comment 21•6 years ago
|
||
I took the meta off this because its not a meta bug, has specific implementation work that I will be doing, any reason to take the meta off it?
Updated•6 years ago
|
| Assignee | ||
Comment 22•6 years ago
|
||
¯_(ツ)_/¯
| Assignee | ||
Comment 23•6 years ago
|
||
Cleaned up a little, and this is what I have so far
I have a repository for the script that does the conversions so we can keep it up to date if any engine changes land before this does, and any big changes can be done fairly quickly - https://github.com/daleharvey/ffx-opensearch-to-webext
Most of this should be good I believe, I didnt do any constructing urls so we should avoid introducing any bugs that way, each locale specifies their own full url, they all share an icon except yandex who gets a localised version
The main call that I am not sure is right is where to split up the locale / lang-region / engine (and what the default locale is). As Shane said this can be fairly arbitrary and we can change the line to wherever Mike draws it, but for right now I treat enginename-* as a single engine for everything except yahoo-jp-auctions and google-2018 which get set manually as distinct engines (https://github.com/daleharvey/ffx-opensearch-to-webext/blob/master/index.js#L367)
And for every engine that doesnt specify a locale in its filename, gets defaulted to 'en' as its locale. I started picking what seemed like sensible defaults (gd_GB for bbc-alba etc) but I am not sure we need that at all and we may want to just take the localisation aspect out of these single language engines completely
| Assignee | ||
Comment 24•6 years ago
|
||
Btw realised I converted these of an old build that didnt include 'google-b-1-d' etc, I have an updated version where these are just listed as seperate engines, will update soon as my other patch is up but can still discuss the locale issues
| Assignee | ||
Comment 25•6 years ago
|
||
More up to date
| Assignee | ||
Comment 26•6 years ago
|
||
So this started as a question, but is slowly become a request for confirmation now, one of the last remaining open questions is how we make the distinction between locale / engine.
Currently we have multiple opensearch definitions for the same 'engine' in different 'locales', we have wikipedia for 30+ languages but we also have 6 opensearch definitions for google, all targeting english (some for the US region, others targeting different firefox versions)
Shane added support for us to be able to use multiple locales within a single engine so we could have a single wikipedia engine that contained all of its locales which is much nicer, but leads to how we handle the cases where the different engines dont really map to locales well, we have 3 choices in terms of directory structure
#1. We can do as we currently do, one web extension per locale
search/
- google-2018
- google-b-1-d
- wikipedia
- wikipedia-af
#2. We can do one engine with everything as a seperate locale:
search/
- google/
- 2018
- b-1-d
- default?
- wikipedia/
- af
#3. We can use different locales when things map to locales, and use different engines when they dont
search/
- google-2018
- google-b-1-d
- wikipedia/
- af
#1 and #2 are both fairly straightforward, they dont require any changes to absearch or list.json
#3 makes the most sense but to implement we would need to reinterpret how we define engines because we currently use - as a seperator for 'locales' (google-2018, wikipedia-af) either we could change list.json + absearch data to refer to locales differently (wikipedia:af) or have a translation table in nsSearchService that just hardcodes the fact that some engines understand locales
I think it would be reasonable to rule out changes to absearch, its fairly complicated to handle changes across firefox versions, I think doing translations inside nsSearchService is also quite complicated (they are already translated @ https://hg.mozilla.org/projects/cedar/file/tip/toolkit/components/search/nsSearchService.js#l595)
I think we should stick with what we currently do (#1), it isnt elegant in its locale handling but requires no changes to the way we handle engines in nsSearchService, list.json or absearch and doesnt have any risk of us getting the engine codes wrong.
If we want to take advantage of the ability to organise the locales differently I think it would be best to do seperately in a follow up.
| Assignee | ||
Comment 27•6 years ago
|
||
Trying that again, my bugzilla seems to have markdown enabled so didnt notice that it didnt format for everyone else
(#1) We can do as we currently do, one web extension per locale
- search/
- google-2018
- google-b-1-d
- wikipedia
- wikipedia-af
(#2) We can do one engine with everything as a seperate locale:
- search/
- google/
- 2018
- b-1-d
- default?
- wikipedia/
- af
- google/
(#3) We can use different locales when things map to locales, and use different engines when they dont
- search/
- google-2018
- google-b-1-d
- wikipedia/
- af
| Reporter | ||
Comment 28•6 years ago
|
||
I don't understand the reason to consider #3.
With google, everyone on desktop outside the US is configured for google-b-d. This is still an english opensearch file (strings in the file). That should just be google-en.
There is the mobile version, which should just rely on the mobile url (see D8012). This would remove the need to translate to google-b-m or google-b-1-m. Those would just be contained in google-en and google-en-US. If we need something further for mobile we can do further updates to what we handle in the manifest for this, or make this the exception for where we have an extra extension, google-android.xpi. The search service can use ${name}-${AppConstants.platform} as the base name for the extension, requiring no support in list.json to differentiate between the two.
For the US region the override is google-b-1-d. That should be google-en-US.
The items I don't understand are google-b-1-e and google-b-e. These are in the experimental-hidden section, I'm unsure how that section is used. While I haven't tested it in the webext code, locales do support variants. We could use en-name-US variants when needed. That is typically used for dialects IIUC, but for our use case it could map well to experiments (assuming that's what that section is used for).
Assuming that list.json is the only place these new google names exist, and that convertGoogleEngines exists to fixup data from absearch, we can drop convertGoogleEngines entirely and only translate google-2018 to google.
The google extension would contain:
google/_locale/en
google/_locale/en-US
The manifest.json would set the default_locale to en.
list.json would have regionOverrides.US.google-2018: google-en-US
| Assignee | ||
Comment 29•6 years ago
|
||
Happy to rule out #3, I was worried that overloading locales for things that arent locales (-2018, -b-1-d) was confusing, but yeh it would cause a bunch of problems.
As for the proposal of changing b-1-d to en-US, I think what you are proposing sounds a lot cleaner and certainly makes sense to use the extra capability that web extensions have, but not sure it makes sense to do it at the same time (at the very least in the same patch) as the initial switch
I think we can be pretty much ready to get 1 extension per open search engine into review today, then look at using the new functionality given by web extensions on follow up patch(es)
Comment 30•6 years ago
|
||
Please don't rename the plugins. #3 is probably closer to the right end state, but we can handle that in a followup.
| Assignee | ||
Comment 31•6 years ago
|
||
| Assignee | ||
Comment 32•6 years ago
|
||
Comment 33•6 years ago
|
||
Comment 34•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/111b88dd28d6
https://hg.mozilla.org/mozilla-central/rev/041d3ca2a427
| Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Description
•