Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-new-window

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-new-window - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

3

es/index.d.ts

@@ -37,2 +37,3 @@ import React from 'react';

released: boolean;
windowCheckerInterval: any;
container: HTMLDivElement;

@@ -62,3 +63,3 @@ state: State;

*/
release: (event?: Event) => void;
release: (event?: any) => void;
}

@@ -65,0 +66,0 @@ /**

@@ -40,2 +40,6 @@ import React from 'react';

this.released = true;
if (this.windowCheckerInterval) {
clearInterval(this.windowCheckerInterval);
this.windowCheckerInterval = null;
}
window.removeEventListener('beforeunload', this.onMainWindowUnload);

@@ -68,3 +72,3 @@ this.window.removeEventListener('beforeunload', this.release);

openChild() {
const { url, title, name, width, height, initPopupInnerRect, initPopupOuterRect, onBlock, onOpen, } = this.props;
const { url, title, name, width, height, initPopupInnerRect, initPopupOuterRect, onBlock, onOpen, onClose, } = this.props;
let features = { width, height };

@@ -107,2 +111,9 @@ if (initPopupOuterRect) {

}
if (url && onClose) {
this.windowCheckerInterval = setInterval(() => {
if (!this.window || this.window.closed) {
this.release(true);
}
}, 50);
}
// Release anything bound to this component before the new window unload.

@@ -109,0 +120,0 @@ this.window.addEventListener('beforeunload', this.release);

@@ -37,2 +37,3 @@ import React from 'react';

released: boolean;
windowCheckerInterval: any;
container: HTMLDivElement;

@@ -62,3 +63,3 @@ state: State;

*/
release: (event?: Event) => void;
release: (event?: any) => void;
}

@@ -65,0 +66,0 @@ /**

@@ -45,2 +45,6 @@ "use strict";

this.released = true;
if (this.windowCheckerInterval) {
clearInterval(this.windowCheckerInterval);
this.windowCheckerInterval = null;
}
window.removeEventListener('beforeunload', this.onMainWindowUnload);

@@ -73,3 +77,3 @@ this.window.removeEventListener('beforeunload', this.release);

openChild() {
const { url, title, name, width, height, initPopupInnerRect, initPopupOuterRect, onBlock, onOpen, } = this.props;
const { url, title, name, width, height, initPopupInnerRect, initPopupOuterRect, onBlock, onOpen, onClose, } = this.props;
let features = { width, height };

@@ -112,2 +116,9 @@ if (initPopupOuterRect) {

}
if (url && onClose) {
this.windowCheckerInterval = setInterval(() => {
if (!this.window || this.window.closed) {
this.release(true);
}
}, 50);
}
// Release anything bound to this component before the new window unload.

@@ -114,0 +125,0 @@ this.window.addEventListener('beforeunload', this.release);

{
"name": "rc-new-window",
"version": "0.1.7",
"version": "0.1.8",
"description": "popup new browser window with react",

@@ -5,0 +5,0 @@ "keywords": [

@@ -66,3 +66,3 @@ # rc-new-window

<td></td>
<td>Use url instead of children content<br/>If cross domain url is used, callbacks might not work</td>
<td>Use url instead of children content</td>
</tr>

@@ -127,3 +127,3 @@ <tr>

<td></td>
<td>callback when window is closed by user</td>
<td>callback when window is closed</td>
</tr>

@@ -130,0 +130,0 @@ <tr>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc