feat(sync): add logseq protocol

This commit is contained in:
Tienson Qin
2021-12-23 16:17:29 +08:00
committed by rcmerci
parent b185eeb0a2
commit 918f6f8613
2 changed files with 15 additions and 2 deletions

View File

@@ -4,6 +4,13 @@ module.exports = {
packagerConfig: {
name: 'Logseq',
icon: './icons/logseq_big_sur.icns',
protocols: [
{
"protocol":"logseq",
"name":"logseq",
"schemes":"logseq"
}
],
osxSign: {
identity: 'Developer ID Application: Tiansheng Qin',
'hardened-runtime': true,

View File

@@ -18,7 +18,7 @@
[electron.exceptions :as exceptions]
["/electron/utils" :as utils]))
(defonce LSP_SCHEME "lsp")
(defonce LSP_SCHEME "logseq")
(defonce LSP_PROTOCOL (str LSP_SCHEME "://"))
(defonce PLUGIN_URL (str LSP_PROTOCOL "logseq.io/"))
(defonce STATIC_URL (str LSP_PROTOCOL "logseq.com/"))
@@ -38,7 +38,7 @@
:logger logger
:win win})))
(defn setup-interceptor! []
(defn setup-interceptor! [win]
(.registerFileProtocol
protocol "assets"
(fn [^js request callback]
@@ -62,6 +62,12 @@
(callback #js {:path path'}))))
(.registerHttpProtocol
protocol LSP_SCHEME
(fn [^js request callback]
;; placeholder
(.loadURL MAIN_WINDOW_ENTRY)))
#(do
(.unregisterProtocol protocol LSP_SCHEME)
(.unregisterProtocol protocol "assets")))