diff --git a/searx/preferences.py b/searx/preferences.py index 9c549cc01..4d0cc5c0a 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -411,6 +411,17 @@ class Preferences: 'on': True, } ), + 'query_in_title': MapSetting( + settings['ui']['query_in_title'], + is_locked('query_in_title'), + map={ + '': settings['ui']['query_in_title'], + '0': False, + '1': True, + 'True': True, + 'False': False + } + ), } self.engines = EnginesSetting('engines', choices=engines) diff --git a/searx/settings.yml b/searx/settings.yml index 5e7fb8224..c4ea6ebdb 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -66,6 +66,9 @@ ui: static_path: "" # Custom templates path - leave it blank if you didn't change templates_path: "" + # query_in_title: When true, the result page's titles contains the query + # it decreases the privacy, since the browser can records the page titles. + query_in_title: false # ui theme default_theme: oscar # Default interface locale - leave blank to detect from browser information or @@ -93,6 +96,7 @@ ui: # - language # - autocomplete # - method +# - query_in_title # searx supports result proxification using an external service: # https://github.com/asciimoo/morty uncomment below section if you have running diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py index 69b6a0fb7..db020db7d 100644 --- a/searx/settings_defaults.py +++ b/searx/settings_defaults.py @@ -188,6 +188,7 @@ SCHEMA = { }, 'results_on_new_tab': SettingsValue(bool, False), 'advanced_search': SettingsValue(bool, False), + 'query_in_title': SettingsValue(bool, False), 'categories_order': SettingsValue(list, CATEGORY_ORDER), }, 'preferences': { diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 5c187140f..e5a7a9423 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -280,6 +280,17 @@ {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }} {% endif %} + {% if 'query_in_title' not in locked_preferences %} + {% set query_in_title_label = _('Query in the page\'s title') %} + {% set query_in_title_info = _('When enabled, the result page\'s title contains your query. Your browser can record this title') %} + {{ preferences_item_header(query_in_title_info, query_in_title_label, rtl, 'query_in_title') }} + + {{ preferences_item_footer(query_in_title_info, query_in_title_label, rtl) }} + {% endif %} + {{ plugin_of_category('privacy' )}} diff --git a/searx/templates/oscar/results.html b/searx/templates/oscar/results.html index b5bedcd44..ce99fe0ac 100644 --- a/searx/templates/oscar/results.html +++ b/searx/templates/oscar/results.html @@ -16,7 +16,7 @@ {%- endmacro %} {%- macro search_url() %}{{ url_for('search', _external=True) }}?q={{ q|urlencode }}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if time_range %}&time_range={{ time_range }}{% endif %}{% if current_language != 'all' %}&language={{ current_language }}{% endif %}{% endmacro -%} -{% block title %}{{ q|e }} - {% endblock %} +{% block title %}{% if query_in_title %}{{- q|e -}} - {% endif %}{% endblock %} {% block meta %}{{" "}}{% endblock %} {% block content %} {% include 'oscar/search.html' %} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 23f6355f5..3fb962bd3 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -256,6 +256,18 @@