Here's my patch. Unfortunately it only applies currently to the US English locale. I will need to investigate how to update our tor-browser-bundle.git code (a la #18915 (moved)). But if this patch looks OK I will add it to our #20680 (moved) branch:
Do you know if the browser.search.* prefs are set from the values that are included in browser/locales/search/list.json?
Also, do we need to change the en-US US and CA entries in that file? I assume the browser uses the US entries if it detects that the user is located in the USA and CA if in Canada (although maybe we disabled that kind of location detection? I cannot remember).
For non-en-US locales, will it work to just patch browser/locales/search/list.json for each locale that we care to change? That won't work if the language packs override those settings though.
Do you know if the browser.search.* prefs are set from the values that are included in browser/locales/search/list.json?
Yes, they appear to be.
Also, do we need to change the en-US US and CA entries in that file? I assume the browser uses the US entries if it detects that the user is located in the USA and CA if in Canada (although maybe we disabled that kind of location detection? I cannot remember).
I believe that location detection is disabled, because we have browser.search.geoSpecificDefaults set to false.
For non-en-US locales, will it work to just patch browser/locales/search/list.json for each locale that we care to change? That won't work if the language packs override those settings though.
Unfortunately it doesn't work -- the language packs each contains a list.json file that overrides these settings. So we'll need to update the #18915 (moved) patch as I mentioned in comment:7.
Unfortunately it doesn't work -- the language packs each contains a list.json file that overrides these settings. So we'll need to update the #18915 (moved) patch as I mentioned in comment:7.
Here is a radical idea: modify browser/locales/search/list.json to only contain a "default" entry and remove the list.json file from each language pack during our packaging phase. I don't know if everything would work correctly if we did that, but it might.
Unfortunately it doesn't work -- the language packs each contains a list.json file that overrides these settings. So we'll need to update the #18915 (moved) patch as I mentioned in comment:7.
Here is a radical idea: modify browser/locales/search/list.json to only contain a "default" entry and remove the list.json file from each language pack during our packaging phase. I don't know if everything would work correctly if we did that, but it might.
I think that's a good suggestion and it might work. I will give it a try.
Unfortunately it doesn't work -- the language packs each contains a list.json file that overrides these settings. So we'll need to update the #18915 (moved) patch as I mentioned in comment:7.
Here is a radical idea: modify browser/locales/search/list.json to only contain a "default" entry and remove the list.json file from each language pack during our packaging phase. I don't know if everything would work correctly if we did that, but it might.
For some reason removing all but the default entry doesn't work, even for US English. nsSearchService.js is pretty convoluted so I'm not sure why. My current approach is to change all locales we deploy to include the same search engine list, and then rely on our #18915 (moved) patches for tor-browser-bundle.git to copy these search engines and the list to each locale xpi. It's awkward, but it seems like it should work. Unfortunately I'm having trouble getting tor-browser-bundle.git to build right now, so I haven't fully tested this. But here is the patch in any case:
This API is for WebExtensions, which means there should be no privacy implications unless someone installs an add-on that they do not trust (something we definitely do not recommend).
For some reason removing all but the default entry doesn't work, even for US English. nsSearchService.js is pretty convoluted so I'm not sure why. My current approach is to change all locales we deploy to include the same search engine list, and then rely on our #18915 (moved) patches for tor-browser-bundle.git to copy these search engines and the list to each locale xpi. It's awkward, but it seems like it should work. Unfortunately I'm having trouble getting tor-browser-bundle.git to build right now, so I haven't fully tested this. But here is the patch in any case:
This patch looks okay, except should the URLs in ddg-onion.xml be https instead of http?
Regarding the changes needed for packaging (builders/tor-browser-bundle.git), Kathy and I wonder if it will work to simply remove browser/chrome/$LOCALE/locale/browser/searchplugins from each of the language packs. But we have not tried it.
For some reason removing all but the default entry doesn't work, even for US English. nsSearchService.js is pretty convoluted so I'm not sure why. My current approach is to change all locales we deploy to include the same search engine list, and then rely on our #18915 (moved) patches for tor-browser-bundle.git to copy these search engines and the list to each locale xpi. It's awkward, but it seems like it should work. Unfortunately I'm having trouble getting tor-browser-bundle.git to build right now, so I haven't fully tested this. But here is the patch in any case:
This patch looks okay, except should the URLs in ddg-onion.xml be https instead of http?
Good point. I changed that.
Regarding the changes needed for packaging (builders/tor-browser-bundle.git), Kathy and I wonder if it will work to simply remove browser/chrome/$LOCALE/locale/browser/searchplugins from each of the language packs. But we have not tried it.
I tried this and couldn't get it to work. It seems Firefox doesn't fall back to the default plugins list as I would have expected. But I could be missing something. In any case I added the patch to my 20680 branch.
Trac: Status: needs_review to closed Resolution: N/Ato fixed