From e0413f8ebe96c7ca034e47c7997da57dd2534b94 Mon Sep 17 00:00:00 2001 From: hieuvu Date: Wed, 14 Oct 2020 10:05:28 +0700 Subject: [PATCH] MOBILE-3569 resource: Allow IFRAME to use XHTML --- src/addon/mod/resource/providers/helper.ts | 2 +- src/assets/js/iframe-treat-links.js | 2 +- src/providers/utils/iframe.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/addon/mod/resource/providers/helper.ts b/src/addon/mod/resource/providers/helper.ts index 62a00e511..c1566e931 100644 --- a/src/addon/mod/resource/providers/helper.ts +++ b/src/addon/mod/resource/providers/helper.ts @@ -142,7 +142,7 @@ export class AddonModResourceHelperProvider { mimetype = this.mimetypeUtils.getMimeType(ext); } - return mimetype == 'text/html'; + return mimetype == 'text/html' || mimetype == 'application/xhtml+xml'; } /** diff --git a/src/assets/js/iframe-treat-links.js b/src/assets/js/iframe-treat-links.js index 68f83571b..c585c96fe 100644 --- a/src/assets/js/iframe-treat-links.js +++ b/src/assets/js/iframe-treat-links.js @@ -49,7 +49,7 @@ // Find the link being clicked. var el = event.target; - while (el && el.tagName !== 'A') { + while (el && (el.tagName !== 'A' && el.tagName !== 'a')) { el = el.parentElement; } diff --git a/src/providers/utils/iframe.ts b/src/providers/utils/iframe.ts index 0fdc5af74..6a044b558 100644 --- a/src/providers/utils/iframe.ts +++ b/src/providers/utils/iframe.ts @@ -329,7 +329,7 @@ export class CoreIframeUtilsProvider { // Find the link being clicked. let el = event.target; - while (el && el.tagName !== 'A') { + while (el && el.tagName !== 'A' && el.tagName !== 'a') { el = el.parentElement; }