fix(electron): open custom protocol links as default condition

This commit is contained in:
charlie
2022-10-13 12:21:31 +08:00
committed by Tienson Qin
parent c6a3eb2de0
commit 3068868347
2 changed files with 2 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ const { ipcRenderer, contextBridge, shell, clipboard, webFrame } = require('elec
const IS_MAC = process.platform === 'darwin'
const IS_WIN32 = process.platform === 'win32'
const ALLOWED_EXTERNAL_PROTOCOLS = ['https:', 'http:', 'mailto:']
const ALLOWED_EXTERNAL_PROTOCOLS = ['https:', 'http:', 'mailto:', 'zotero:', 'file:']
function getFilePathFromClipboard () {
if (IS_WIN32) {

View File

@@ -115,8 +115,7 @@
(when parsed-url
(condp contains? (.-protocol parsed-url)
#{"https:" "http:" "mailto:"} (.openExternal shell url)
#{"file:"} (when (empty? (.-host parsed-url)) (default-open url))
nil))))
(default-open url)))))
(defn setup-window-listeners!
[^js win]