Merge pull request #1443 from dpalou/MOBILE-2550
MOBILE-2550 core: Fix error when iterating querySelectorAllmain
commit
6483bff49a
|
@ -682,7 +682,7 @@ export class CoreDomUtilsProvider {
|
||||||
const element = this.convertToElement(html);
|
const element = this.convertToElement(html);
|
||||||
|
|
||||||
// Treat elements with src (img, audio, video, ...).
|
// 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) => {
|
media.forEach((media: HTMLElement) => {
|
||||||
let newSrc = paths[this.textUtils.decodeURIComponent(media.getAttribute('src'))];
|
let newSrc = paths[this.textUtils.decodeURIComponent(media.getAttribute('src'))];
|
||||||
|
|
||||||
|
@ -700,7 +700,7 @@ export class CoreDomUtilsProvider {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Now treat links.
|
// Now treat links.
|
||||||
anchors = element.querySelectorAll('a');
|
anchors = Array.from(element.querySelectorAll('a'));
|
||||||
anchors.forEach((anchor: HTMLElement) => {
|
anchors.forEach((anchor: HTMLElement) => {
|
||||||
const href = this.textUtils.decodeURIComponent(anchor.getAttribute('href')),
|
const href = this.textUtils.decodeURIComponent(anchor.getAttribute('href')),
|
||||||
newUrl = paths[href];
|
newUrl = paths[href];
|
||||||
|
|
Loading…
Reference in New Issue