How to create your own Accessibility Tools with AI

Most readers will likely have noticed that AI can now also be used to write code. This makes it possible to build your own accessibility testing tools without having any coding skills.

Why would you want to do that, considering there are already numerous bookmarklets and browser plugins that leave almost nothing to be desired? Using bookmarklets is becoming increasingly difficult on most websites due to CSP (Content Security Policy): CSP is designed to prevent third-party scripts from running on a website and stealing user data. Browser plugins usually work, but they don't always do what you want them to do. In some environments, it is simply not possible to install additional tools.

The preferred method is to use the browser console—a feature integrated into browser developer tools designed to run scripts on a website. Open the browser DevTools in your browser of choice and select the Console tab. There, you can simply paste the generated scripts and press Enter to run them. By the way, you can also paste the code from bookmarklets into the console; it functions differently than triggering bookmarklets directly from your bookmarks.

How do you get the right code generated? Go to the AI of your choice and describe as precisely as possible what the script should do. For example, I had a script created to display ARIA on the website as well as changes to attributes. However, you can also share an idea for a script and ask the AI which settings it considers useful. For instance, you could have it highlight the text structure, form labels and groupings, or alternative texts.

Once you have generated the script, copy the code and paste it into the console. The results will be visible immediately. If you are satisfied, save the script so you can use it regularly. If you want to make changes, return to the AI and specify your desired modifications.

For safety reasons, I am not sharing the scripts I had created, as I cannot evaluate their potential harmfulness. The browser console itself shouldn't pose a security risk; nevertheless, you bear the responsibility yourself for anticipating any potential harmful effects.

More on Testing & Evaluation