Make analytics and DNT detection work
This commit is contained in:
parent
419aa55f14
commit
647b0e216a
@ -31,6 +31,6 @@
|
||||
}
|
||||
],
|
||||
"permissions": ["tabs", "https://hn.algolia.com/*"],
|
||||
"content_security_policy": "script-src 'self' 'unsafe-eval' 'sha256-CfMPE8ys/ylJ5D9qKG0a9/UejrcczMr4/EmFCbVbgcc=' 'sha256-XsBu2nEJnS7x/Izq1v7dzy3Ze5myJMHvg4zukh/R1Yk=' 'sha256-AUCho1UyOpYFSZDg8EM9SYlysRIrUpQKZ7iE9CFSYfU=' 'sha256-vLlTaRFN8A2FPadIx711FwK9Ytd6LXkAzuEYAdC0D1k='; object-src 'self'; connect-src 'self' https://hn.algolia.com",
|
||||
"content_security_policy": "script-src 'self' 'unsafe-eval' 'sha256-CfMPE8ys/ylJ5D9qKG0a9/UejrcczMr4/EmFCbVbgcc=' 'sha256-XsBu2nEJnS7x/Izq1v7dzy3Ze5myJMHvg4zukh/R1Yk=' 'sha256-AUCho1UyOpYFSZDg8EM9SYlysRIrUpQKZ7iE9CFSYfU=' 'sha256-vLlTaRFN8A2FPadIx711FwK9Ytd6LXkAzuEYAdC0D1k=' 'sha256-uM0I4me9aSUPORchT/KpGrvBQV6915H0JG2FGR5+BOs=' https://cdn.amplitude.com; object-src 'self'; connect-src 'self' https://hn.algolia.com",
|
||||
"web_accessible_resources": ["sidebar.html", "js/*.map", "js/generated/*.map", "js/generated/out/*"]
|
||||
}
|
||||
|
32
project.clj
32
project.clj
@ -11,20 +11,22 @@
|
||||
:plugins [[lein-cljsbuild "1.1.7"]]
|
||||
:profiles {:cljs-shared
|
||||
{:cljsbuild
|
||||
{:builds [{:source-paths ["src"]
|
||||
:compiler {:optimizations :simple
|
||||
:pretty-print true
|
||||
:source-map true
|
||||
:output-dir "ext/js/generated/out"
|
||||
:modules {:background
|
||||
{:output-to "ext/js/generated/background.js"
|
||||
:entries #{"looped-in.background"}}
|
||||
:content
|
||||
{:output-to "ext/js/generated/content.js"
|
||||
:entries #{"looped-in.content"}}
|
||||
:sidebar
|
||||
{:output-to "ext/js/generated/sidebar.js"
|
||||
:entries #{"looped-in.sidebar"}}}}}]}}
|
||||
:dev {:dependencies [[com.cemerick/piggieback "0.2.2"]
|
||||
{:builds
|
||||
{:main
|
||||
{:source-paths ["src"]
|
||||
:compiler {:optimizations :simple
|
||||
:pretty-print true
|
||||
:source-map true
|
||||
:output-dir "ext/js/generated/out"
|
||||
:modules {:background
|
||||
{:output-to "ext/js/generated/background.js"
|
||||
:entries #{"looped-in.background"}}
|
||||
:content
|
||||
{:output-to "ext/js/generated/content.js"
|
||||
:entries #{"looped-in.content"}}
|
||||
:sidebar
|
||||
{:output-to "ext/js/generated/sidebar.js"
|
||||
:entries #{"looped-in.sidebar"}}}}}}}}
|
||||
:dev {:deoendencies [[com.cemerick/piggieback "0.2.2"]
|
||||
[org.clojure/tools.nrepl "0.2.10"]]
|
||||
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}})
|
||||
|
@ -9,7 +9,7 @@
|
||||
(defn do-not-track
|
||||
"Returns true if Do Not Track is enabled"
|
||||
[]
|
||||
(= (.-doNotTrack js/navigator) 1))
|
||||
(= (.-doNotTrack js/navigator) "1"))
|
||||
|
||||
(defn init-amplitude
|
||||
"Injects the Amplitude bootstrapping script if DNT is disabled"
|
||||
|
Loading…
Reference in New Issue
Block a user