Preserve the user URL preferences for subsequent requests
This MR makes the URL preferences be saved for each subsequent request
The user preferences would be updated according to the URL param contents.
How to test
The current behavior
The following steps describe how to reproduce the current behavior. Do not follow them in this MR branch
- Set your theme to dark mode
- Go to the
/preferences
page - Copy the preferences URL
- Open an anonymous browser tab
- Paste the preferences URL and update the last
q=%s
toq=dog
- At the search results page, confirm that you are in dark mode
- Go to the images page, confirm that you lost the dark mode
Since we expect that our preferences would be saved, the lost of the dark mode on the last step is a weird experience.
The behavior of this MR
- After
git checkout preserve-preferences-cookies
, runsudo make run
- Set your theme to dark mode
- Go to the
/preferences
page - Copy the preferences URL
- Open an anonymous browser tab
- Paste the preferences URL and update the last
q=%s
toq=dog
- At the search results page, confirm that you are in dark mode
- Go to the images page, confirm that you still have the dark mode
Better experience
Now the user can set the "URL preference" as a default search engine (that's why we have the q=%s
part) and still have it's preferences saved and used again and again for each use on the website
Relates to e/backlog#1154 (closed) and https://github.com/searx/searx/issues/2958