summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2022-05-15 20:42:37 +0200
committerGitHub <noreply@github.com>2022-05-15 20:42:37 +0200
commitf814ac703b25640d28ab3a4a096f693808cde6db (patch)
tree7dc3ad14a12b72f8b52010bf1cc9ab5442aa0765
parent173c14544e918891b2cb788615294ccb157892ae (diff)
parent7d443dfea389d8bfaaa90142d3c1a6c1a068d5a9 (diff)
downloadsearxng-f814ac703b25640d28ab3a4a096f693808cde6db.tar.gz
searxng-f814ac703b25640d28ab3a4a096f693808cde6db.zip
Merge pull request #1202 from julianfairfax/master
Preferences URL in preferences
-rw-r--r--searx/templates/simple/preferences.html5
-rwxr-xr-xsearx/webapp.py5
2 files changed, 10 insertions, 0 deletions
diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html
index 2278237b5..4dde6fec2 100644
--- a/searx/templates/simple/preferences.html
+++ b/searx/templates/simple/preferences.html
@@ -406,6 +406,11 @@
<pre>{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&amp;q=%s{% endraw %}</pre>
</div>
<p class="small_font">{{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}</p>
+ <h4>{{ _('URL to restore your preferences in another browser') }} :</h4>
+ <div class="selectable_url">
+ <pre>{{ url_for('preferences', _external=True) }}?preferences={{ preferences_url_params|e }}&amp;save=1</pre>
+ </div>
+ <p class="small_font">{{ _('Specifying custom settings in the preferences URL can be used to sync preferences across devices.') }}</p>
{{ tab_footer() }}
{{ tabs_close() }}
diff --git a/searx/webapp.py b/searx/webapp.py
index 7eca07753..86de88407 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -971,6 +971,11 @@ def preferences():
# pylint: disable=too-many-locals, too-many-return-statements, too-many-branches
# pylint: disable=too-many-statements
+ # save preferences using the link the /preferences?preferences=...&save=1
+ if request.args.get('save') == '1':
+ resp = make_response(redirect(url_for('index', _external=True)))
+ return request.preferences.save(resp)
+
# save preferences
if request.method == 'POST':
resp = make_response(redirect(url_for('index', _external=True)))