I'm trying to automate testing of the built-in Chrome PDF viewer, specifically, accessing the Download button on the PDF viewer toolbar. The crux of the problem is accessing the correct DOM. I've identified 2 different DOMs.
When I'm on the opened PDF tab and click the 3 dots at the top of the browser, then More Tools > Developer Tools, dev tools comes up in the side panel with a DOM similar to this:
<body style="height: 100%; width: 100%; overflow: hidden; margin:0px; background-color: rgb(82, 86, 89);">
<embed name="7AC33340D20DFBA6C79709A5C2767923" style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="about:blank" type="application/pdf" internalid="7AC33340D20DFBA6C79709A5C2767923" />
</body>
When I right click anywhere in the rendered PDF or chrome of the viewer itself (left navigation panel, toolbar) and choose Inspect, dev tools is opened in a separate window with a different DOM that includes all of the chrome elements (nav, toolbar), as well as the embedded PDF file.
When I try to access the chrome using WebDriver IO, I can only see the "outer" DOM, not the full PDF viewer UI. Is there a way to get to that?