diff --git a/frontend/src/download.js b/frontend/src/download.js index 21db9ccb..f879bcc5 100644 --- a/frontend/src/download.js +++ b/frontend/src/download.js @@ -1,6 +1,6 @@ require('./common'); const FileReceiver = require('./fileReceiver'); -const { notify, findMetric, sendEvent } = require('./utils'); +const { notify, findMetric, gcmCompliant, sendEvent } = require('./utils'); const bytes = require('bytes'); const Storage = require('./storage'); const storage = new Storage(localStorage); @@ -11,6 +11,14 @@ require('jquery-circle-progress'); const Raven = window.Raven; $(document).ready(function() { + gcmCompliant().catch(err => { + $('#download').attr('hidden', true); + sendEvent('recipient', 'unsupported', { + cd6: err + }).then(() => { + location.replace('/unsupported'); + }); + }); //link back to homepage $('.send-new').attr('href', window.location.origin); diff --git a/frontend/src/upload.js b/frontend/src/upload.js index e836d297..7e3b8e66 100644 --- a/frontend/src/upload.js +++ b/frontend/src/upload.js @@ -27,10 +27,10 @@ if (storage.has('referrer')) { $(document).ready(function() { gcmCompliant().catch(err => { $('#page-one').attr('hidden', true); - $('#unsupported-browser').removeAttr('hidden'); - // record unsupported event sendEvent('sender', 'unsupported', { cd6: err + }).then(() => { + location.replace('/unsupported'); }); }); diff --git a/server/server.js b/server/server.js index 1b7b4f03..eff63e07 100644 --- a/server/server.js +++ b/server/server.js @@ -80,6 +80,10 @@ app.get('/', (req, res) => { res.render('index'); }); +app.get('/unsupported', (req, res) => { + res.render('unsupported'); +}); + app.get('/jsconfig.js', (req, res) => { res.set('Content-Type', 'application/javascript'); res.render('jsconfig', { diff --git a/views/index.handlebars b/views/index.handlebars index 3cf5f63b..47a77a6f 100644 --- a/views/index.handlebars +++ b/views/index.handlebars @@ -71,15 +71,3 @@ - - diff --git a/views/unsupported.handlebars b/views/unsupported.handlebars new file mode 100644 index 00000000..62814e57 --- /dev/null +++ b/views/unsupported.handlebars @@ -0,0 +1,11 @@ +
+
+
+ + +
Firefox
+ +
+
+
+