From 83aa3398d7246531af681e9630204c1713212327 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 14 Aug 2018 10:51:05 +0200 Subject: [PATCH] MOBILE-2550 core: Fix error when iterating querySelectorAll --- src/providers/utils/dom.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/providers/utils/dom.ts b/src/providers/utils/dom.ts index 3e03e9d41..b7744aa30 100644 --- a/src/providers/utils/dom.ts +++ b/src/providers/utils/dom.ts @@ -682,7 +682,7 @@ export class CoreDomUtilsProvider { const element = this.convertToElement(html); // Treat elements with src (img, audio, video, ...). - media = element.querySelectorAll('img, video, audio, source, track'); + media = Array.from(element.querySelectorAll('img, video, audio, source, track')); media.forEach((media: HTMLElement) => { let newSrc = paths[this.textUtils.decodeURIComponent(media.getAttribute('src'))]; @@ -700,7 +700,7 @@ export class CoreDomUtilsProvider { }); // Now treat links. - anchors = element.querySelectorAll('a'); + anchors = Array.from(element.querySelectorAll('a')); anchors.forEach((anchor: HTMLElement) => { const href = this.textUtils.decodeURIComponent(anchor.getAttribute('href')), newUrl = paths[href];