If we remove that line, the point of this PR is moot. And document.activeElement only returns the currently active element, so I don't know how this would help.
Unless there is a clever way of determining if the viewer is embedded, this PR will not work.

I totally forgot about testing this in embedded PDFs, sorry about that!