mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-22 19:32:54 +03:00
Fixed Explore iframe route handling hijacking routes on reload
This commit is contained in:
parent
c7ef22d4df
commit
8d9b8cf79c
@ -20,7 +20,8 @@ export default class GhBillingIframe extends Component {
|
||||
this.billing.getBillingIframe().src = this.billing.getIframeURL();
|
||||
|
||||
window.addEventListener('message', (event) => {
|
||||
if (event?.data) {
|
||||
// only process messages coming from the billing iframe
|
||||
if (event?.data && this.billing.getIframeURL().includes(event?.origin)) {
|
||||
if (event.data?.request === 'token') {
|
||||
this._handleTokenRequest();
|
||||
}
|
||||
|
@ -12,7 +12,8 @@ export default class GhExploreIframe extends Component {
|
||||
this.explore.getExploreIframe().src = this.explore.getIframeURL();
|
||||
|
||||
window.addEventListener('message', async (event) => {
|
||||
if (event?.data) {
|
||||
// only process messages coming from the explore iframe
|
||||
if (event?.data && this.explore.getIframeURL().includes(event?.origin)) {
|
||||
if (event.data?.request === 'apiUrl') {
|
||||
this._handleUrlRequest();
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ export default class ExploreService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
return url += '/';
|
||||
return url;
|
||||
}
|
||||
|
||||
// Sends a route update to a child route in the BMA, because we can't control
|
||||
|
Loading…
Reference in New Issue
Block a user