added missing exit event cases

This commit is contained in:
Danny Coates 2017-08-09 16:44:09 -07:00
parent 493bf8dc89
commit 16aa7983ed
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB

View file

@ -41,6 +41,11 @@ function urlToMetric(url) {
return 'twitter'; return 'twitter';
case 'https://www.mozilla.org/firefox/new/?scene=2': case 'https://www.mozilla.org/firefox/new/?scene=2':
return 'download-firefox'; return 'download-firefox';
case 'https://qsurvey.mozilla.com/s3/txp-firefox-send':
return 'survey';
case 'https://testpilot.firefox.com/':
case 'https://testpilot.firefox.com/experiments/send':
return 'testpilot';
default: default:
return 'other'; return 'other';
} }
@ -198,7 +203,7 @@ function exitEvent(target) {
function addExitHandlers() { function addExitHandlers() {
const links = Array.from(document.querySelectorAll('a')); const links = Array.from(document.querySelectorAll('a'));
links.forEach(l => { links.forEach(l => {
if (/^http/.test(l.href)) { if (/^http/.test(l.getAttribute('href'))) {
l.addEventListener('click', exitEvent); l.addEventListener('click', exitEvent);
} }
}); });