Merge pull request #491 from mozilla/i387

added missing exit event cases
This commit is contained in:
Danny Coates 2017-08-10 09:06:57 -07:00 committed by GitHub
commit 314ab237ec
1 changed files with 6 additions and 1 deletions

View File

@ -51,6 +51,11 @@ function urlToMetric(url) {
return 'twitter';
case 'https://www.mozilla.org/firefox/new/?scene=2':
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:
return 'other';
}
@ -208,7 +213,7 @@ function exitEvent(target) {
function addExitHandlers() {
const links = Array.from(document.querySelectorAll('a'));
links.forEach(l => {
if (/^http/.test(l.href)) {
if (/^http/.test(l.getAttribute('href'))) {
l.addEventListener('click', exitEvent);
}
});