only _blank links while downloading. fixed safari link after download

This commit is contained in:
Danny Coates 2017-08-05 09:40:57 -07:00
parent 432a39d313
commit 859554ce21
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
8 changed files with 74 additions and 60 deletions

View file

@ -79,41 +79,10 @@ function gcmCompliant() {
}
}
function findMetric(href) {
switch (href) {
case 'https://www.mozilla.org/':
return 'mozilla';
case 'https://www.mozilla.org/about/legal':
return 'legal';
case 'https://testpilot.firefox.com/about':
return 'about';
case 'https://testpilot.firefox.com/privacy':
return 'privacy';
case 'https://testpilot.firefox.com/terms':
return 'terms';
case 'https://www.mozilla.org/privacy/websites/#cookies':
return 'cookies';
case 'https://github.com/mozilla/send':
return 'github';
case 'https://twitter.com/FxTestPilot':
return 'twitter';
case 'https://www.mozilla.org/firefox/new/?scene=2':
return 'download-firefox';
default:
return 'other';
}
}
function isFile(id) {
return /^[0-9a-fA-F]{10}$/.test(id);
}
function sendEvent() {
return window.analytics.sendEvent
.apply(window.analytics, arguments)
.catch(() => 0);
}
function copyToClipboard(str) {
const aux = document.createElement('input');
aux.setAttribute('value', str);
@ -143,8 +112,6 @@ module.exports = {
hexToArray,
notify,
gcmCompliant,
findMetric,
isFile,
sendEvent,
ONE_DAY_IN_MS
};