You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{createRule}from'@acot/core';typeOptions={};exportdefaultcreateRule<Options>({immutable: true,meta: {help: 'https://www.w3.org/WAI/WCAG21/Understanding/page-titled.html',},test: async(context)=>{consttitle=awaitcontext.page.evaluate(()=>document.title);context.debug('title="%s"',title);if(!title){constnode=await(async()=>{try{constel=awaitcontext.page.$('head');returnel??undefined;}catch(e){context.debug(e);returnundefined;}})();awaitcontext.report({
node,message: 'Page MUST have a title.',});}},});
docs/rules/page-has-title.md
# page-has-title
Web pages have titles that describe topic or purpose. WCAG 2.1 - 2.4.2.
## :white_check_mark: Correct```html acot-head
<title>Meaningful title text</title>
```## :warning: Incorrect```html acot-head
<title></title>
```