Users can define a default namespace selection in the currrent namespace search UI. This selection should be used as default namespace selection when using the advanced search, too.
Listen to what the backend gives you as namespaces that should be shown, and show them (equivalent to how the current namespace search box behaves)
- When the user goes onto SpecialSearch:Page, their default preferences are shown in the namespaces bar
- When a user is redirected from a search they submitted in the searchbox in the upper right corner, their default preferences are shown in the namespace par
- When the search is sent with a different set of namespaces, these ones are used (so a reload does not lead to suddenly changed namespaces)
- We don't change preferences
The namespace selection can be found in mw.user.options.searchNs + number