From 26fd6e88309ddc7c575a7bec15e5b3bcd3acd657 Mon Sep 17 00:00:00 2001 From: Oliver Byford Date: Tue, 19 Mar 2019 13:37:37 +0000 Subject: [PATCH] Allow banner to be hidden with ?hide_banner=yes This is useful for e.g. automated screenshots using Browserstack --- app/banner.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/banner.js b/app/banner.js index 60ef5b8832..18290de90a 100644 --- a/app/banner.js +++ b/app/banner.js @@ -8,6 +8,11 @@ module.exports = function (app) { app.use(function (request, response, next) { let cookie = request.cookies[BANNER_COOKIE_NAME] + if (request.query.hide_banner === 'yes') { + app.locals.shouldShowAppBanner = false + return next() + } + if (cookie === 'yes') { app.locals.shouldShowAppBanner = false return next()