mirror of
https://github.com/logseq/logseq.git
synced 2026-05-25 05:04:24 +00:00
fix: filter protocols on open
This commit is contained in:
committed by
Andelf
parent
d238c88afd
commit
81a6d23c4d
@@ -112,9 +112,11 @@
|
||||
[url default-open]
|
||||
(let [URL (.-URL URL)
|
||||
parsed-url (try (URL. url) (catch :default _ nil))]
|
||||
(if (and parsed-url (contains? #{"https:" "http:" "mailto:"} (.-protocol parsed-url)))
|
||||
(.openExternal shell url)
|
||||
(when default-open (default-open url)))))
|
||||
(when parsed-url
|
||||
(condp contains? (.-protocol parsed-url)
|
||||
#{"https:" "http:" "mailto:"} (.openExternal shell url)
|
||||
#{"file:"} (default-open url)
|
||||
nil))))
|
||||
|
||||
(defn setup-window-listeners!
|
||||
[^js win]
|
||||
|
||||
Reference in New Issue
Block a user