|
@@ -79,8 +79,7 @@
|
|
|
(defn electron?
|
|
(defn electron?
|
|
|
[]
|
|
[]
|
|
|
(when (and js/window (gobj/get js/window "navigator"))
|
|
(when (and js/window (gobj/get js/window "navigator"))
|
|
|
- (let [ua (string/lower-case js/navigator.userAgent)]
|
|
|
|
|
- (string/includes? ua " electron")))))
|
|
|
|
|
|
|
+ (gstring/caseInsensitiveContains js/navigator.userAgent " electron"))))
|
|
|
|
|
|
|
|
#?(:cljs
|
|
#?(:cljs
|
|
|
(defn mocked-open-dir-path
|
|
(defn mocked-open-dir-path
|
|
@@ -486,7 +485,10 @@
|
|
|
|
|
|
|
|
#?(:cljs
|
|
#?(:cljs
|
|
|
(defn safe-path-join [prefix & paths]
|
|
(defn safe-path-join [prefix & paths]
|
|
|
- (apply node-path.join (cons prefix paths))))
|
|
|
|
|
|
|
+ (let [path (apply node-path.join (cons prefix paths))]
|
|
|
|
|
+ (if (and (electron?) (gstring/caseInsensitiveStartsWith path "file://"))
|
|
|
|
|
+ (subs path 7)
|
|
|
|
|
+ path))))
|
|
|
|
|
|
|
|
(defn trim-safe
|
|
(defn trim-safe
|
|
|
[s]
|
|
[s]
|