|
|
@@ -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")))
|