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

electron-panel

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-panel - npm Package Compare versions

Comparing version 1.3.4 to 1.3.5

6

CHANGELOG.md
## CHANGELOG
### v1.3.5
- Add `panel.closeAll()`.
### v1.3.4
- Return closed results when calling `panel.close()`.
- Return closed results when calling `panelFrame.close()`.

@@ -7,0 +11,0 @@ ### v1.3.2

@@ -43,1 +43,5 @@ # Panel (renderer process)

Find panel frame via `panelID`.
### panel.closeAll ()
Close all panels. If any of the panel cancel close, none of the panel will be closed.

33

lib/renderer/panel-frame.js

@@ -387,4 +387,4 @@ 'use strict';

if ( this.beforeUnload ) {
let stopUnload = this.beforeUnload();
if ( stopUnload ) {
let cancel = this.beforeUnload();
if ( cancel ) {
return false;

@@ -395,14 +395,3 @@ }

// handle unload
if ( this._ipcListener ) {
this._ipcListener.clear();
}
if ( this._mousetrapList ) {
this._mousetrapList.forEach(mousetrap => {
mousetrap.reset();
});
}
this.remove();
// remove it from panel list
panel._remove(this);
this._unload();
return true;

@@ -488,2 +477,18 @@ }

_unload () {
// handle unload
if ( this._ipcListener ) {
this._ipcListener.clear();
}
if ( this._mousetrapList ) {
this._mousetrapList.forEach(mousetrap => {
mousetrap.reset();
});
}
this.remove();
// remove it from panel list
panel._remove(this);
}
_apply ( proto ) {

@@ -490,0 +495,0 @@ let mode = proto.mode; // can be 'light', 'shadow' and 'iframe', default is 'shadow'

@@ -87,2 +87,28 @@ 'use strict';

/**
* @method closeAll
*
* Close all panels. If any of the panel cancel close, none of the panel will be closed.
*/
panel.closeAll = function () {
let panelFrames = Object.values(_id2panelFrame);
for ( let i = 0; i < panelFrames.length; ++i ) {
let frameEL = panelFrames[i];
if ( frameEL.beforeUnload ) {
let stopUnload = frameEL.beforeUnload();
if ( stopUnload ) {
return false;
}
}
}
for ( let i = 0; i < panelFrames.length; ++i ) {
let frameEL = panelFrames[i];
frameEL._unload();
}
return true;
};
/**
* @property panels

@@ -89,0 +115,0 @@ *

{
"name": "electron-panel",
"version": "1.3.4",
"version": "1.3.5",
"description": "Manipulate panels in window for Electron",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -99,2 +99,4 @@ # electron-panel

- [Test] panel2panel-reply
- [Test] panelFrame.close()
- [Test] panel.closeAll()

@@ -101,0 +103,0 @@ ## License

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