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/templates/simple | |
| 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/templates/simple')
| -rw-r--r-- | searx/templates/simple/base.html | 6 | ||||
| -rw-r--r-- | searx/templates/simple/preferences.html | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index 3ddc62ace..c8e75b713 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -51,7 +51,11 @@ {%- endif -%} {%- endblock -%} {%- block linkto_preferences -%} - <a href="{{ url_for('preferences') }}" class="link_on_top_preferences">{{ icon_big('settings') }}<span>{{ _('Preferences') }}</span></a> + {%- if request.args.get('preferences') -%} + <a href="{{ url_for('preferences') }}?preferences={{ request.args.get('preferences') }}&preferences_preview_only=true" class="link_on_top_preferences">{{ icon_big('settings') }}<span>{{ _('Preferences') }}</span></a> + {%- else -%} + <a href="{{ url_for('preferences') }}" class="link_on_top_preferences">{{ icon_big('settings') }}<span>{{ _('Preferences') }}</span></a> + {%- endif -%} {%- endblock -%} </nav> {% block header %} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index e86e926cc..87bd99c45 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -155,6 +155,16 @@ <h1>{{ _('Preferences') }}</h1> + {%- if request.args.get('preferences_preview_only') == 'true' -%} + <div class="dialog-warning-block"> + <p>{{ _("This is a preview of the settings used by the 'Search URL' you used to get here.") }}</p> + <ul> + <li>{{ _('Press save to copy these preferences to your browser.') }}</li> + <li>{{ _('Click here to view your browser preferences instead:') }} <a href="{{ url_for('preferences') }}">/preferences</a></li> + </ul> + </div> + {%- endif -%} + <form id="search_form" method="post" action="{{ url_for('preferences') }}" autocomplete="off"> {{- tabs_open() -}} |