From 416b9902cb0fef41bf64ad96d9803f1600b55a4a Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Tue, 20 Nov 2018 12:00:32 -0800 Subject: [PATCH] added a webmanifest (#1023) --- server/layout.js | 2 ++ server/routes/index.js | 1 + server/routes/webmanifest.js | 28 ++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 server/routes/webmanifest.js diff --git a/server/layout.js b/server/layout.js index 7f78ea92..5fd7d337 100644 --- a/server/layout.js +++ b/server/layout.js @@ -36,6 +36,8 @@ module.exports = function(state, body = '') { content="${state.baseUrl}${assets.get('send-twitter.jpg')}" /> + + ${state.title} diff --git a/server/routes/index.js b/server/routes/index.js index 1934212e..2a813428 100644 --- a/server/routes/index.js +++ b/server/routes/index.js @@ -70,6 +70,7 @@ module.exports = function(app) { app.get('/oauth', language, pages.blank); app.get('/legal', language, pages.legal); app.get('/jsconfig.js', require('./jsconfig')); + app.get('/app.webmanifest', language, require('./webmanifest')); app.get(`/download/:id${ID_REGEX}`, language, pages.download); app.get('/unsupported/:reason', language, pages.unsupported); app.get(`/api/download/:id${ID_REGEX}`, auth.hmac, require('./download')); diff --git a/server/routes/webmanifest.js b/server/routes/webmanifest.js new file mode 100644 index 00000000..30f9aa66 --- /dev/null +++ b/server/routes/webmanifest.js @@ -0,0 +1,28 @@ +const assets = require('../../common/assets'); + +module.exports = function(req, res) { + const manifest = { + name: 'Firefox Send', + short_name: 'Send', + lang: req.language, + icons: [ + { + src: assets.get('favicon-144.png'), + type: 'image/png', + sizes: '144x144' + }, + { + src: assets.get('send_logo.svg'), + type: 'image/svg', + sizes: '192x192 512x512' + } + ], + start_url: '/', + display: 'standalone', + orientation: 'portrait', + theme_color: '#0a84ff', + background_color: 'white' + }; + res.set('Content-Type', 'application/manifest+json'); + res.json(manifest); +};