diff --git a/app/filter.py b/app/filter.py index 6b4e284..8c3b780 100644 --- a/app/filter.py +++ b/app/filter.py @@ -104,6 +104,8 @@ class Filter: input_form = soup.find('form') if input_form is not None: input_form['method'] = 'GET' if self.config.get_only else 'POST' + # Use a relative URI for submissions + input_form['action'] = 'search' # Ensure no extra scripts passed through for script in soup('script'): @@ -394,6 +396,16 @@ class Filter: if href.startswith(MAPS_URL): # Maps links don't work if a site filter is applied link['href'] = MAPS_URL + "?q=" + clean_query(q) + elif href.startswith('/?') or href.startswith('/search?'): + # make sure that tags can be clicked as relative URLs + link['href'] = href[1:] + elif href.startswith('/intl/'): + # do nothing, keep original URL for ToS + pass + elif href.startswith('/preferences'): + # there is no config specific URL, remove this + link.decompose() + return else: link['href'] = href diff --git a/app/templates/search.html b/app/templates/search.html index 4695291..073b7ed 100644 --- a/app/templates/search.html +++ b/app/templates/search.html @@ -1,4 +1,4 @@ -