Skip to content

Commit 76a76f8

Browse files
committed
formatters: when installing, display a warning related to issue 55
1 parent 8dd8b9c commit 76a76f8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib/devtools/formatters.cljs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181
new-formatters-js (if (empty? new-formatters) nil (into-array new-formatters))]
8282
(set-formatters-safe! new-formatters-js)))
8383

84+
(defn display-formatters-removal-warning! []
85+
(let [console (context/get-console)]
86+
(.warn console (str "Custom formatters are likely to be removed from future Chrome. "
87+
"Enabling them is no longer sticky since Chrome 84. "
88+
"Please follow the issue here: https://github.com/binaryage/cljs-devtools/issues/55"))))
89+
8490
; -- installation -----------------------------------------------------------------------------------------------------------
8591

8692
(defn installed? []
@@ -89,6 +95,8 @@
8995
(defn install! []
9096
(when-not *installed*
9197
(set! *installed* true)
98+
(if-not (prefs/pref :dont-display-formatters-removal-warning)
99+
(display-formatters-removal-warning!))
92100
(install-our-formatter! (build-cljs-formatter))
93101
true))
94102

0 commit comments

Comments
 (0)