From 49393ce16ac0a2b4246654c6bf5e241baf5ba499 Mon Sep 17 00:00:00 2001 From: Laura Wrubel Date: Tue, 9 Aug 2022 15:25:38 -0700 Subject: [PATCH] Improve replay banner's accessibility (#742) * Puts banner in header and nav landmark regions * Adds landmark role of banner to header --- pywb/static/default_banner.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pywb/static/default_banner.js b/pywb/static/default_banner.js index 33dcdf04..26530139 100644 --- a/pywb/static/default_banner.js +++ b/pywb/static/default_banner.js @@ -148,6 +148,10 @@ This file is part of pywb, https://github.com/webrecorder/pywb * @param {string} bid - The id for the banner */ DefaultBanner.prototype.createBanner = function(bid) { + this.header = document.createElement('header'); + this.header.setAttribute('role', 'banner'); + this.nav = document.createElement('nav'); + this.banner = document.createElement('wb_div', true); this.banner.setAttribute('id', bid); this.banner.setAttribute('lang', 'en'); @@ -208,8 +212,9 @@ This file is part of pywb, https://github.com/webrecorder/pywb } this.banner.appendChild(ancillaryLinks); - - document.body.insertBefore(this.banner, document.body.firstChild); + this.nav.appendChild(this.banner); + this.header.appendChild(this.nav); + document.body.insertBefore(this.header, document.body.firstChild); }; /**