Skip to content

Commit

Permalink
Allow banner to be hidden with ?hide_banner=yes
Browse files Browse the repository at this point in the history
This is useful for e.g. automated screenshots using Browserstack
  • Loading branch information
36degrees authored and hannalaakso committed Apr 2, 2019
1 parent d721963 commit 26fd6e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 26fd6e8

Please sign in to comment.