
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-window-opener
Advanced tools
A small reactjs utility to make sure that window.open actually opens popup and cominecate with the parent window.opner
A small reactjs utility to make sure that window.open actually opens popup and cominecate with the parent window.opener
If you are using React and opening a window popup for any reason like Google authentication, for example, you will need to pass the data back to the parent page. but as you are using react you can't access the function in your page components via 'window.opener'،
https://ahakem.github.io/react-window.opener/#/
npm install react-window-opener
or
yarn add react-window-opener
import WindowOpener from 'react-window-opener'
export default function Example {
const childResponse = (err, res) => {
if (err) {
console.log(res, 'err')
}
console.log(res, 'res')
}
return (
<WindowOpener url='/popUp-URL' bridge={childResponse}>
)
}
just pass the needed data using
window.opener.onSuccess(state)
export default function SmallWindow() {
const [state, setstate] = useState('')
const update = (evt) => {
setstate(evt.target.value)
window.opener.onSuccess(state)
}
return (
<>
<input value={state} onChange={update} />
<button
onClick={() => {
window.close()
}}
>
Close Me
</button>
</>
)
}
All you need to import it like that more info here
import dynamic from 'next/dynamic'
const WindowOpener = dynamic(() => import('react-window-opener'), { ssr: false })
| Params | Value | Default Value | Description |
|---|---|---|---|
| url | string | REQUIRED | the url for the page which will open in the popup |
| bridge | function | REQUIRED | Function to handel the result that you will pass from the child popup |
| width | number | 300 | PopUp Width |
| height | number | 400 | PopUp Height |
| className | Empty |
MIT © ahakem
The idea came from this repo with some enhancment EnetoJara/window-opener
FAQs
A small reactjs utility to make sure that window.open actually opens popup and cominecate with the parent window.opner
The npm package react-window-opener receives a total of 21 weekly downloads. As such, react-window-opener popularity was classified as not popular.
We found that react-window-opener demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.