OpenINF / openinf.github.io

Found the usage of undeclared variables JS-0125
Bug risk
Critical
17 occurrences in this check
'goatcounter' is not defined
264			}
265
266			if (!goatcounter.no_events)
267				goatcounter.bind_events()268		})
269})();
'goatcounter' is not defined
263				document.addEventListener('visibilitychange', f)
264			}
265
266			if (!goatcounter.no_events)267				goatcounter.bind_events()
268		})
269})();
'goatcounter' is not defined
258					if (document.visibilityState !== 'visible')
259						return
260					document.removeEventListener('visibilitychange', f)
261					goatcounter.count()262				}
263				document.addEventListener('visibilitychange', f)
264			}
'goatcounter' is not defined
252			// 2. Page is not yet visible; wait until it switches to 'visible' and count.
253			// See #487
254			if (!('visibilityState' in document) || document.visibilityState === 'visible')
255				goatcounter.count()256			else {
257				var f = function(e) {
258					if (document.visibilityState !== 'visible')
'goatcounter' is not defined
246		}
247	}
248
249	if (!goatcounter.no_onload)250		on_load(function() {
251			// 1. Page is visible, count request.
252			// 2. Page is not yet visible; wait until it switches to 'visible' and count.
'goatcounter' is not defined
180
181		var send = function(elem) {
182			return function() {
183				goatcounter.count({184					event:    true,
185					path:     (elem.dataset.goatcounterClick || elem.name || elem.id || ''),
186					title:    (elem.dataset.goatcounterTitle || elem.title || (elem.innerHTML || '').substr(0, 200) || ''),
'goatcounter' is not defined
146		if (f)
147			return warn('not counting because of: ' + f)
148
149		var url = goatcounter.url(vars)150		if (!url)
151			return warn('not counting because path callback returned null')
152
'goatcounter' is not defined
142
143	// Count a hit.
144	window.goatcounter.count = function(vars) {
145		var f = goatcounter.filter()146		if (f)
147			return warn('not counting because of: ' + f)
148
'goatcounter' is not defined
119			return 'frame'
120		if (!goatcounter.allow_local && location.hostname.match(/(localhost$|^127\.|^10\.|^172\.(1[6-9]|2[0-9]|3[0-1])\.|^192\.168\.|^0\.0\.0\.0$)/))
121			return 'localhost'
122		if (!goatcounter.allow_local && location.protocol === 'file:')123			return 'localfile'
124		if (localStorage && localStorage.getItem('skipgc') === 't')
125			return 'disabled with #toggle-goatcounter'
'goatcounter' is not defined
117			return 'visibilityState'
118		if (!goatcounter.allow_frame && location !== parent.location)
119			return 'frame'
120		if (!goatcounter.allow_local && location.hostname.match(/(localhost$|^127\.|^10\.|^172\.(1[6-9]|2[0-9]|3[0-1])\.|^192\.168\.|^0\.0\.0\.0$)/))121			return 'localhost'
122		if (!goatcounter.allow_local && location.protocol === 'file:')
123			return 'localfile'
'goatcounter' is not defined
115	goatcounter.filter = function() {
116		if ('visibilityState' in document && document.visibilityState === 'prerender')
117			return 'visibilityState'
118		if (!goatcounter.allow_frame && location !== parent.location)119			return 'frame'
120		if (!goatcounter.allow_local && location.hostname.match(/(localhost$|^127\.|^10\.|^172\.(1[6-9]|2[0-9]|3[0-1])\.|^192\.168\.|^0\.0\.0\.0$)/))
121			return 'localhost'
'goatcounter' is not defined
112	}
113
114	// Filter some requests that we (probably) don't want to count.
115	goatcounter.filter = function() {116		if ('visibilityState' in document && document.visibilityState === 'prerender')
117			return 'visibilityState'
118		if (!goatcounter.allow_frame && location !== parent.location)
'goatcounter' is not defined
 87		var s = document.querySelector('script[data-goatcounter]')
 88		if (s && s.dataset.goatcounter)
 89			return s.dataset.goatcounter
 90		return (goatcounter.endpoint || window.counter)  // counter is for compat; don't use. 91	}
 92
 93	// Get current path.
'goatcounter' is not defined
 27			p: (vars.path     === undefined ? goatcounter.path     : vars.path),
 28			r: (vars.referrer === undefined ? goatcounter.referrer : vars.referrer),
 29			t: (vars.title    === undefined ? goatcounter.title    : vars.title),
 30			e: !!(vars.event || goatcounter.event), 31			s: [window.screen.width, window.screen.height, (window.devicePixelRatio || 1)],
 32			b: is_bot(),
 33			q: location.search,
'goatcounter' is not defined
 26		var data = {
 27			p: (vars.path     === undefined ? goatcounter.path     : vars.path),
 28			r: (vars.referrer === undefined ? goatcounter.referrer : vars.referrer),
 29			t: (vars.title    === undefined ? goatcounter.title    : vars.title), 30			e: !!(vars.event || goatcounter.event),
 31			s: [window.screen.width, window.screen.height, (window.devicePixelRatio || 1)],
 32			b: is_bot(),
'goatcounter' is not defined
 25	var get_data = function(vars) {
 26		var data = {
 27			p: (vars.path     === undefined ? goatcounter.path     : vars.path),
 28			r: (vars.referrer === undefined ? goatcounter.referrer : vars.referrer), 29			t: (vars.title    === undefined ? goatcounter.title    : vars.title),
 30			e: !!(vars.event || goatcounter.event),
 31			s: [window.screen.width, window.screen.height, (window.devicePixelRatio || 1)],
'goatcounter' is not defined
 24	// Get all data we're going to send off to the counter endpoint.
 25	var get_data = function(vars) {
 26		var data = {
 27			p: (vars.path     === undefined ? goatcounter.path     : vars.path), 28			r: (vars.referrer === undefined ? goatcounter.referrer : vars.referrer),
 29			t: (vars.title    === undefined ? goatcounter.title    : vars.title),
 30			e: !!(vars.event || goatcounter.event),