electron-panel
Advanced tools
Comparing version 1.3.2 to 1.3.3
19
index.js
'use strict'; | ||
const platform = require('electron-platform'); | ||
const pkgJson = require('./package.json'); | ||
let panel; | ||
let name = `__electron_panel__`; | ||
let msg = `Failed to require ${pkgJson.name}@${pkgJson.version}: | ||
A different version of ${pkgJson.name} already running in the process, we will redirect to it. | ||
Please make sure your dependencies use the same version of ${pkgJson.name}.`; | ||
if ( platform.isMainProcess ) { | ||
panel = require('./lib/main'); | ||
if (global[name]) { | ||
console.warn(msg); | ||
panel = global[name]; | ||
} else { | ||
panel = global[name] = require('./lib/main'); | ||
} | ||
} else { | ||
panel = require('./lib/renderer/index'); | ||
if (window[name]) { | ||
console.warn(msg); | ||
panel = window[name]; | ||
} else { | ||
panel = window[name] = require('./lib/renderer/index'); | ||
} | ||
} | ||
@@ -12,0 +27,0 @@ |
'use strict'; | ||
if ( global.__electron_panel__ ) { | ||
const pkgJson = require('../package.json'); | ||
console.warn(`A different version of electron-panel already running in the process: ${pkgJson.version}, redirect to it. Please make sure your dependencies use the same version of electron-panel.`); | ||
module.exports = global.__electron_panel__; | ||
return; | ||
} | ||
const {app, ipcMain, BrowserWindow} = require('electron'); | ||
@@ -24,3 +16,2 @@ const ipcPlus = require('electron-ipc-plus'); | ||
module.exports = panel; | ||
global.__electron_panel__ = panel; | ||
@@ -27,0 +18,0 @@ /** |
'use strict'; | ||
if ( window.__electron_panel__ ) { | ||
const pkgJson = require('../../package.json'); | ||
console.warn(`A different version of electron-panel already running in the process: ${pkgJson.version}, redirect to it. Please make sure your dependencies use the same version of electron-panel.`); | ||
module.exports = window.__electron_panel__; | ||
return; | ||
} | ||
const {ipcRenderer} = require('electron'); | ||
@@ -17,3 +9,2 @@ const ipcPlus = require('electron-ipc-plus'); | ||
module.exports = panel; | ||
window.__electron_panel__ = panel; | ||
@@ -20,0 +11,0 @@ // ======================================== |
{ | ||
"name": "electron-panel", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Manipulate panels in window for Electron", | ||
@@ -25,3 +25,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"clean-css": "^4.0.7", | ||
"clean-css": "^4.0.8", | ||
"electron-ipc-listener": "^1.0.0", | ||
@@ -28,0 +28,0 @@ "electron-ipc-plus": "^1.3.3", |
@@ -87,5 +87,7 @@ # electron-panel | ||
- [Panel (main process)](docs/panel-main.md) | ||
- [Panel (renderer process)](docs/panel-renderer.md) | ||
- [Panel Frame](docs/panel-frame.md) | ||
- Main Process | ||
- [Panel](docs/panel-main.md) | ||
- Renderer Process | ||
- [Panel](docs/panel-renderer.md) | ||
- [Panel Frame](docs/panel-frame.md) | ||
@@ -92,0 +94,0 @@ ## TODO |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1566
103
55634
Updatedclean-css@^4.0.8