goatCounter: suppress some errors when script is blocked by some adblocker

This commit is contained in:
He4eT 2021-07-19 17:47:12 +05:00
commit 204a513a9a

View file

@ -31,6 +31,8 @@
<script> <script>
window.goatcounter = { no_onload: true } window.goatcounter = { no_onload: true }
window.addEventListener('hashchange', _ => { window.addEventListener('hashchange', _ => {
if (!window.goatcounter.count) return void null
window.goatcounter.count({ window.goatcounter.count({
path: location.pathname + location.hash path: location.pathname + location.hash
}) })