From 88cc0c85e8989e4a6c7c42d001f38af6d4565f50 Mon Sep 17 00:00:00 2001 From: Edwin van Rijkom Date: Tue, 18 Apr 2017 12:29:21 +0200 Subject: [PATCH] Detect running from Framer Cloud MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running from the Framer Cloud, prevent Framer from going into “running inside an iFrame” mode. --- framer/Utils.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/framer/Utils.coffee b/framer/Utils.coffee index f6bfcdca5..e51edfe33 100644 --- a/framer/Utils.coffee +++ b/framer/Utils.coffee @@ -673,7 +673,14 @@ Utils.loadImage = (url, callback, context) -> element.src = url Utils.isInsideIframe = -> - return window isnt window.top + return window isnt window.top unless Utils.isInsideFramerCloud() + return false + +Utils.isInsideFramerCloud = -> + return Utils.getQueryParameters()["cloud"] is "1" + +Utils.getQueryParameters = -> + return _.fromPairs window.location.search.slice(1).split('&').map((val) -> val.split('=')) ###################################################### # GEOMETRY FUNCTIONS