mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 07:43:54 +08:00
use store instead of localStorage to disable GoatCounter
This commit is contained in:
parent
54e4f5e721
commit
b40278f4dc
2 changed files with 5 additions and 2 deletions
|
@ -412,10 +412,12 @@ def setup_do_not_track(app):
|
|||
@app.route("/dnt")
|
||||
def do_not_track():
|
||||
return """
|
||||
<script src="/static/local-storage-polyfill.js"></script>
|
||||
|
||||
<script>
|
||||
// Disable GoatCounter if this script is called
|
||||
|
||||
window.localStorage.setItem('goatcounter-ignore', 't');
|
||||
store.set('goatcounter-ignore', 't');
|
||||
|
||||
alert("GoatCounter disabled");
|
||||
|
||||
|
|
|
@ -174,6 +174,7 @@
|
|||
{% block script %}
|
||||
{% endblock %}
|
||||
|
||||
<script src="/static/local-storage-polyfill.js"></script>
|
||||
<script>
|
||||
(function () {
|
||||
// only enable on prod
|
||||
|
@ -182,7 +183,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
if (localStorage.getItem('goatcounter-ignore') === 't') {
|
||||
if (store.get('goatcounter-ignore') === 't') {
|
||||
console.log("GoatCounter is disabled");
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue