Skip to content

Conversation

lejara
Copy link

@lejara lejara commented Apr 30, 2022

In Firefox,
i noticed the script would crash if the this.window is null on line

this.container = this.window.document.createElement('div')

and this.setState({ mounted: true }) is set regardless.

This pr fixes this issue which allows onBlock to be called.

// Open a new window.
this.window = window.open(url, name, toWindowFeatures(features))
this.container = this.window.document.createElement('div')
this.container = this.window?.document.createElement('div')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// Release anything bound to this component before the new window unload.
this.window.addEventListener('beforeunload', () => this.release())

this.setState({ mounted: true })
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check why is this needed.

@rmariuzzo rmariuzzo changed the title Fix onBlock not being called during a block Fix onBlock not being called during a block Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants