Skip to content

Commit 7705be9

Browse files
authored
fix cross-origin iframe and no parent debugbar (php-debugbar#651)
* fix `cross-origin` iframe and no parent debugbar * fix iframe flag default value
1 parent 20cffd7 commit 7705be9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/DebugBar/Resources/debugbar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,11 @@ if (typeof(PhpDebugBar) == 'undefined') {
425425
this.activeDatasetId = null;
426426
this.datesetTitleFormater = new DatasetTitleFormater(this);
427427
this.options.bodyMarginBottomHeight = parseInt($('body').css('margin-bottom'));
428-
this.isIframe = window.self !== window.top;
428+
try {
429+
this.isIframe = window.self !== window.top && window.top.phpdebugbar;
430+
} catch (error) {
431+
this.isIframe = false;
432+
}
429433
this.registerResizeHandler();
430434
},
431435

0 commit comments

Comments
 (0)