diff options
| author | 2022-09-04 21:28:20 +0200 | |
|---|---|---|
| committer | 2022-09-04 21:28:20 +0200 | |
| commit | 2e0fbf60e752aaa6e58178a6e8388537010a2f47 (patch) | |
| tree | b9f0fb78a6b1320df836b3fc67249beb2e0156c8 /p/scripts | |
| parent | d921be63f67fe22a4c822c0a37a5da113512d0c8 (diff) | |
fix: space key opens empty tab (#4581)
* Update main.js
* Update p/scripts/main.js
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
* fix
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Diffstat (limited to 'p/scripts')
| -rw-r--r-- | p/scripts/main.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index ad3224507..b0a6df01b 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1001,12 +1001,14 @@ function init_shortcuts() { if (context.auto_mark_site) { mark_read(document.querySelector('.flux.current'), true, false); } + + const link_go_website = document.querySelector('.flux.current a.go_website'); const newWindow = window.open(); - if (newWindow) { + if (link_go_website && newWindow) { newWindow.opener = null; - newWindow.location = document.querySelector('.flux.current a.go_website').href; + newWindow.location = link_go_website.href; + ev.preventDefault(); } - ev.preventDefault(); return; } if (k === s.skip_next_entry) { next_entry(true); ev.preventDefault(); return; } |
