

And, while that may (or may not) create accessibility problems for assistive technology, it most definitely creates problems for testing. After all, if a frame is effectively a web page, how can that page have no source? The answer is that the contents are generated on-the-fly by other JavaScript content on the page.
Iframe test code#
But things take a turn when I use my code inspector (described above) and find that the rendered content on the right side of the screen is living in an iframe (as shown in the screenshot below) and that the iframe has no src attribute. This is shown in the screenshot above, as I make changes to the HTML code on the left side of the page, these changes are shown as rendered HTML on the right side of the page after pressing the "run" button. One big problem from a testing perspective comes to iframes that do not have a static src attribute and where content is generated dynamically.įor instance, if you’ve ever tried to learn HTML, CSS, or JavaScript, you have probably tinkered around on and their useful "Try it Yourself" feature. Dynamically Generated iFrame ContentĪlas, these solutions are far from perfect when it comes to iframes. In addition, the Social Security Administration’s ANDI Tool will also detect and open iframes to allow that tool to effectively review the contents of iframes. Both of these extensions add back the lost iframe function to Chrome. A quick Google search for "extensions for opening iframes" reveals "Open iFrame" and "Open Frame" in the Chrome store. Since then, other developers have created Chrome extensions to add this feature right back. Once upon a time, Chrome had a feature that let you right-click on an iframe and open that frame in a new tab or window. It is a little clumsy at first, but once you have done it a few times, it is quick and easy-and amazingly effective! Extensions and ANDI This is our preferred recommendation for customers who want to do their own testing. For instance, the screenshot below shows that ANDI reports that the text input field in the iframe is inaccessible because it is not programmatically labelled. You can also run any bookmarklet on that iframe once you get it out of the iframe.

Now just copy that URL, open it in a separate browser tab, and voilà, you have a page that can be tested using basic tools! For instance, below we have the form elements quickly identified by the Forms Accessibility Bookmarklet. The screenshot above shows the element-and the src attribute for that element ( ) is clearly visible. In Chrome, for instance, you would open the developer tools (Ctrl+Shift+I) and use the Elements tab to find the iframe in the source code. The most direct way to open this text message alert iframe in a separate window or tab is to find the URL for the page in the page’s source code. In the middle of the TxDOT page on is an iframe which includes a text input field that lets the user request text message alerts of traffic events in a highway project maintained by TxDOT. Let us review how that is done by looking at a simple example from the Texas Department of Transportation (TxDOT). In general, automated tools and bookmarklets can work relatively well if the contents can be rendered in a separate page or tab. While there are a few automated tools that claim to test the contents of iframe's, their success varies considerably. Because the content of the iframe is effectively a separate page, these tools generally cannot "see" inside the iframe and so the iframe remains a black hole.

The reason it is a problem is that many automated tools, such as automated accessibility scanners and accessibility bookmarklets, can only test the page that contains the iframe. The problem comes up in testing iframes for accessibility. In fact, making the contents of an iframe accessible usually follows the same rules as any other web content. IFrames themselves do not really create accessibility problems for users. These iframe elements are not just used for embedded videos, they also sneak up in a lot of other content-and in particularly with pop-up content (e.g., chat bots, dialogs, etc.). In fact, most of the time when you encounter embedded videos on web pages, that content is contained within an iframes. Inline frames (i.e., iframes) are quite a bit less cumbersome than regular frames.

Frames effectively combined content from different web pages into a single page within the element. If you were an Internet user in the 1990’s, you will remember how some web pages used to have "hard" dividers-and each section of the page included content that seemed to be from different sources. 's are "inline frames", and they are a more modern version of the elements found on many web pages in the 1990's and are now deprecated with the release of HTML5.
