rmariuzzo / react-new-window

🔲 Pop new windows in React, using `window.open`.

Home Page:https://rmariuzzo.github.io/react-new-window/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"TypeError: null is not an object" error when browser popups are blocked

blutter opened this issue · comments

The error "TypeError: null is not an object" will appear when browser popups are blocked and the NewWindow component is rendered.

This error started occurring in v0.1.3 and appears to be caused by the changes in 1eeae9b

Specifically the change:

    this.window = window.open(url, name, toWindowFeatures(features))
-
+   this.container = this.window.document.createElement('div')

When blockups are blocked then window.open() returns null.

A workaround is to downgrade to v0.1.2

Hi! I have the same problem, is this resolved?