From c69d1cf87179ad77a245fb7a745731ce666630bf Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Tue, 10 Nov 2020 23:44:53 +1100 Subject: [PATCH] fix: fix doNotTrack polyfill (#87) * fix: dnt not working issue * fix: dnt pollyFill incorrect external msTrackingProtectionEnabled logic --- lib/module.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/module.js b/lib/module.js index 4abbf6e..df56b0f 100644 --- a/lib/module.js +++ b/lib/module.js @@ -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')