milesmcc / shynet

Modern, privacy-friendly, and detailed web analytics that works without cookies or JS.
Apache License 2.0
2.89k stars 183 forks source link

Don't phone home when browser has DNT enabled, and project respects DNT #255

Closed milesmcc closed 1 year ago

milesmcc commented 1 year ago

Would love it if someone submitted a PR for this issue! Otherwise I'll try to get to it soon.

haaavk commented 1 year ago

Requests with DNT are already ignored at backend so I assume we're talking about JS tracker not sending request at all. There is JS api to detect DNT enabled in browser but according to MDN it's deprecated. (https://developer.mozilla.org/en-US/docs/Web/API/navigator/doNotTrack) I suggest to send empty (or almost empty) page.js script when DNT header is set. I can do PR if this approach is ok.

milesmcc commented 1 year ago

I think that’s the right approach @haaavk — just send a minimal page. If they have script injections etc I think we should still send that.

haaavk commented 1 year ago

It's done. I forgot to add appropriate description so issue need to be closed manually.