dom.ts: Fix typing error

This commit is contained in:
glacambre 2018-03-02 23:52:04 +01:00
parent 368db055f8
commit f7c4007e53
No known key found for this signature in database
GPG key ID: B9625DB1767553AC

View file

@ -231,8 +231,8 @@ export function isVisible (element: Element) {
* @param doc The document the frames should be fetched from
*/
export function getAllDocumentFrames(doc = document) {
let frames = Array.from(doc.getElementsByTagName("iframe"))
.concat(Array.from(doc.getElementsByTagName("frame")))
let frames = (<HTMLIFrameElement[] & HTMLFrameElement[]>Array.from(doc.getElementsByTagName("iframe")))
.concat((Array.from(doc.getElementsByTagName("frame"))))
.filter((frame) => !frame.src.startsWith("moz-extension://"))
return frames.concat(flatten(frames.map((x) => getAllDocumentFrames(x.contentDocument))))
}