Skip to content

Commit

Permalink
fix cross-origin iframe and no parent debugbar (#651)
Browse files Browse the repository at this point in the history
* fix `cross-origin` iframe and no parent debugbar

* fix iframe flag default value
  • Loading branch information
erikn69 committed May 13, 2024
1 parent 20cffd7 commit 7705be9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DebugBar/Resources/debugbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},

Expand Down

0 comments on commit 7705be9

Please sign in to comment.