1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-10 05:02:45 +01:00

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';
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';
}
@ -198,7 +203,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);
}
});