Skip to content

Commit 49393ce

Browse files
authored
Improve replay banner's accessibility (#742)
* Puts banner in header and nav landmark regions * Adds landmark role of banner to header
1 parent a97ad7e commit 49393ce

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pywb/static/default_banner.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ This file is part of pywb, https://github.com/webrecorder/pywb
148148
* @param {string} bid - The id for the banner
149149
*/
150150
DefaultBanner.prototype.createBanner = function(bid) {
151+
this.header = document.createElement('header');
152+
this.header.setAttribute('role', 'banner');
153+
this.nav = document.createElement('nav');
154+
151155
this.banner = document.createElement('wb_div', true);
152156
this.banner.setAttribute('id', bid);
153157
this.banner.setAttribute('lang', 'en');
@@ -208,8 +212,9 @@ This file is part of pywb, https://github.com/webrecorder/pywb
208212
}
209213

210214
this.banner.appendChild(ancillaryLinks);
211-
212-
document.body.insertBefore(this.banner, document.body.firstChild);
215+
this.nav.appendChild(this.banner);
216+
this.header.appendChild(this.nav);
217+
document.body.insertBefore(this.header, document.body.firstChild);
213218
};
214219

215220
/**

0 commit comments

Comments
 (0)