diff options
author | Jinyuan Huang <88757735+BernieHuang2008@users.noreply.github.com> | 2023-11-14 11:25:30 +0000 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-11-14 13:28:50 +0100 |
commit | 903449e0b57c50a0f0ec02e4e2a6c8cb9e923dac (patch) | |
tree | 7e81f22083840582289eb4e0ff62b83cbe347f55 /searx/static | |
parent | 76b91a3ef685e288cc54e6a1131760d9c68faff0 (diff) | |
download | searxng-903449e0b57c50a0f0ec02e4e2a6c8cb9e923dac.tar.gz searxng-903449e0b57c50a0f0ec02e4e2a6c8cb9e923dac.zip |
[fix] Images cannot be clicked anymore #3006
URL in sidedbar only exists in HTTP POST requests. On HTTP GET requests the
selector ``#search_url button#copy_url`` results in a ``null`` type and a
``.style.display`` raises::
Uncaught TypeError: d.querySelector(...) is null
As a result, the initialization of the event handler is no longer carried out.
Closes: https://github.com/searxng/searxng/issues/3003
Suggested-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/static')
-rw-r--r-- | searx/static/themes/simple/src/js/main/results.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/static/themes/simple/src/js/main/results.js b/searx/static/themes/simple/src/js/main/results.js index 2309297df..0b0aebe12 100644 --- a/searx/static/themes/simple/src/js/main/results.js +++ b/searx/static/themes/simple/src/js/main/results.js @@ -16,7 +16,9 @@ } )); - d.querySelector('#search_url button#copy_url').style.display = "block"; + if (d.querySelector('#search_url button#copy_url')) { + d.querySelector('#search_url button#copy_url').style.display = "block"; + } searxng.on('.btn-collapse', 'click', function () { var btnLabelCollapsed = this.getAttribute('data-btn-text-collapsed'); |