diff options
| author | Bnyro <bnyro@tutanota.com> | 2025-10-09 22:03:32 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2025-10-10 18:08:33 +0200 |
| commit | 362cc13aeb5c647387e8ed77cbd4919f86fd0833 (patch) | |
| tree | 2c9856a6553474d65a936e147e3c5cd83e48460b /searx/webapp.py | |
| parent | d28a1c434f67f5fea332d36d553d75276c76f44a (diff) | |
[feat] preferences hash: show applied settings in pref page when searching with 'search url of the currently saved preferences'
Previously, when using a search url copied from the cookies tab, clicking
at the settings icon at the top right would show the browser preferences
and not the preferences that were set and used with the search url.
Please see https://github.com/searxng/searxng/issues/5227 for more information.
To test:
- change some preferences
- copy the preferences search url in the settings' cookies tab
- reset the preferences or clear cookies
- paste the copied search url into the search bar to search for something
- press the settings icon
- you can now see/preview the actual settings that were used for the search
- by pressing 'save', you can keep these preferences
closes #5227
Diffstat (limited to 'searx/webapp.py')
| -rwxr-xr-x | searx/webapp.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 4be087a09..218959a9c 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -861,8 +861,11 @@ def preferences(): # save preferences using the link the /preferences?preferences=... if sxng_request.args.get('preferences') or sxng_request.form.get('preferences'): - resp = make_response(redirect(url_for('index', _external=True))) - return sxng_request.preferences.save(resp) + # if preferences_preview_only is 'true', the prefs from the 'preferences' query are + # shown in the settings page, but they're not applied unless the user presses 'save' + if sxng_request.args.get('preferences_preview_only') != 'true': + resp = make_response(redirect(url_for('index', _external=True))) + return sxng_request.preferences.save(resp) # save preferences if sxng_request.method == 'POST': |