diff --git a/frontend/src/common.js b/frontend/src/common.js index 7baa52b0..c993ed7a 100644 --- a/frontend/src/common.js +++ b/frontend/src/common.js @@ -12,9 +12,7 @@ const analytics = new testPilotGA({ }); function sendEvent() { - return analytics.sendEvent - .apply(analytics, arguments) - .catch(() => 0); + return analytics.sendEvent.apply(analytics, arguments).catch(() => 0); } function findMetric(href) { @@ -60,4 +58,4 @@ module.exports = { Raven, sendEvent, findMetric -} +}; diff --git a/frontend/src/download.js b/frontend/src/download.js index a93ae36d..9663c5f9 100644 --- a/frontend/src/download.js +++ b/frontend/src/download.js @@ -12,7 +12,6 @@ require('jquery-circle-progress'); $(document).ready(function() { gcmCompliant() .then(function() { - $('.send-new').click(function() { sendEvent('recipient', 'restarted', { cd2: 'completed' diff --git a/frontend/src/links.js b/frontend/src/links.js index 5f5a4840..7c207ed9 100644 --- a/frontend/src/links.js +++ b/frontend/src/links.js @@ -1,19 +1,23 @@ +let links = []; -let links = [] - -document.addEventListener('DOMContentLoaded', function () { - links = document.querySelectorAll('a:not([target])') -}) +document.addEventListener('DOMContentLoaded', function() { + links = document.querySelectorAll('a:not([target])'); +}); function setOpenInNewTab(bool) { if (bool === false) { - links.forEach(l => l.removeAttribute('target')); - } - else { - links.forEach(l => l.setAttribute('target', '_blank')); + links.forEach(l => { + l.removeAttribute('target'); + l.removeAttribute('rel'); + }); + } else { + links.forEach(l => { + l.setAttribute('target', '_blank'); + l.setAttribute('rel', 'noopener noreferrer'); + }); } } module.exports = { setOpenInNewTab -} +};