From 4dc35bfc72e926e8b7427b826621fe51f7e9f584 Mon Sep 17 00:00:00 2001 From: Gerhard Sletten Date: Wed, 12 Apr 2017 23:08:05 +0200 Subject: [PATCH] Optional global settings to disable srcdoc, since it will fail on cordova (#588) --- src/managers/default/index.js | 3 ++- src/managers/views/iframe.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/managers/default/index.js b/src/managers/default/index.js index ee96040..bc6caeb 100644 --- a/src/managers/default/index.js +++ b/src/managers/default/index.js @@ -32,7 +32,8 @@ class DefaultViewManager { axis: this.settings.axis, layout: this.layout, width: 0, - height: 0 + height: 0, + globalOptions: extend({}, options.settings, {disableSrcdoc: options.settings.disableSrcdoc || false}) }; } diff --git a/src/managers/views/iframe.js b/src/managers/views/iframe.js index 0dfeaf2..f58072b 100644 --- a/src/managers/views/iframe.js +++ b/src/managers/views/iframe.js @@ -102,7 +102,7 @@ class IframeView { // Firefox has trouble with baseURI and srcdoc // TODO: Disable for now in firefox - if("srcdoc" in this.iframe) { + if("srcdoc" in this.iframe && !this.settings.globalOptions.disableSrcdoc) { this.supportsSrcdoc = true; } else { this.supportsSrcdoc = false;