mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
vanadium/firefox: simplify google search engine
The old customized config would trigger the bot detection all the time.
This commit is contained in:
parent
570e0124f0
commit
2d2cd5f270
1 changed files with 79 additions and 106 deletions
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (pkgs) nur;
|
||||
|
|
@ -11,34 +10,8 @@ in {
|
|||
|
||||
policies = {
|
||||
SearchEngines = {
|
||||
Default = "Google en@en";
|
||||
Remove = ["Google"];
|
||||
Add =
|
||||
# Google specialized for each language x display language
|
||||
# reference: https://developers.google.com/custom-search/docs/xml_results?hl=zh-tw#advanced-search-query-parameters
|
||||
lib.mapCartesianProduct (
|
||||
{
|
||||
lr,
|
||||
hl,
|
||||
}: let
|
||||
lr' = lib.substring 0 2 (lib.removePrefix "lang_" lr);
|
||||
hl' = lib.substring 0 2 hl;
|
||||
in {
|
||||
Name = "Google ${lr'}@${hl'}";
|
||||
Alias =
|
||||
if lib.removePrefix "lang_" lr == hl
|
||||
then "@G" + lr'
|
||||
else "@G" + lr' + hl';
|
||||
Description = "Your data yum yum (but ${lr'} in ${hl'})";
|
||||
IconURL = "https://google.com/favicon.ico";
|
||||
SuggestURLTemplate = "https://suggestqueries.google.com/complete/search?q={searchTerms}&lr=${lr}&hl=${hl}";
|
||||
URLTemplate = "https://google.com/search?q={searchTerms}&lr=${lr}&hl=${hl}";
|
||||
}
|
||||
) {
|
||||
lr = ["lang_fr" "lang_en" "lang_zh-TW"];
|
||||
hl = ["fr" "en" "zh-TW"];
|
||||
}
|
||||
++ [
|
||||
Default = "Google";
|
||||
Add = [
|
||||
# Forges
|
||||
{
|
||||
Name = "GitHub";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue