Skip to content

Commit

Permalink
fix: fix doNotTrack polyfill (#87)
Browse files Browse the repository at this point in the history
* fix: dnt not working issue

* fix: dnt pollyFill incorrect external msTrackingProtectionEnabled logic
  • Loading branch information
tim-yao authored Nov 10, 2020
1 parent cce978d commit c69d1cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { requireNuxtVersion } = require('./compatibility')

// doNotTrack polyfill
// https://gist.github.com/pi0/a76fd97c4ea259c89f728a4a8ebca741
const dnt = "(function(w,n,d,m,e,p){w[d]=(w[d]==1||n[d]=='yes'||n[d]==1||n[m]==1||(w[e]&&w[e].p&&e[e][p]()))?1:0})(window,'navigator','doNotTrack','msDoNotTrack','external','msTrackingProtectionEnabled')"
const dnt = "(function(w,n,d,m,e,p){w[d]=(w[d]==1||n[d]=='yes'||n[d]==1||n[m]==1||(w[e]&&w[e][p]&&w[e][p]()))?1:0})(window,navigator,'doNotTrack','msDoNotTrack','external','msTrackingProtectionEnabled')"

module.exports = async function gtmModule (_options) {
requireNuxtVersion(this.nuxt, '2.12.0')
Expand Down

0 comments on commit c69d1cf

Please sign in to comment.