From 7705be9c2a8f0f8164e10eecab9ef06f0d0945c9 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Mon, 13 May 2024 08:42:06 -0500 Subject: [PATCH] fix `cross-origin` iframe and no parent debugbar (#651) * fix `cross-origin` iframe and no parent debugbar * fix iframe flag default value --- src/DebugBar/Resources/debugbar.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DebugBar/Resources/debugbar.js b/src/DebugBar/Resources/debugbar.js index 96f86a9e..81d60b8d 100644 --- a/src/DebugBar/Resources/debugbar.js +++ b/src/DebugBar/Resources/debugbar.js @@ -425,7 +425,11 @@ if (typeof(PhpDebugBar) == 'undefined') { this.activeDatasetId = null; this.datesetTitleFormater = new DatasetTitleFormater(this); this.options.bodyMarginBottomHeight = parseInt($('body').css('margin-bottom')); - this.isIframe = window.self !== window.top; + try { + this.isIframe = window.self !== window.top && window.top.phpdebugbar; + } catch (error) { + this.isIframe = false; + } this.registerResizeHandler(); },