New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

electron-prompt

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-prompt - npm Package Compare versions

Comparing version 1.6.2 to 1.7.0

.github/workflows/ci.yml

59

lib/index.js

@@ -0,11 +1,40 @@

const path = require('path');
const electron = require('electron');
const BrowserWindow = electron.BrowserWindow || electron.remote.BrowserWindow;
const ipcMain = electron.ipcMain || electron.remote.ipcMain;
const url = require('url');
const path = require('path');
const DEFAULT_WIDTH = 370;
const DEFAULT_HEIGHT = 160;
function getElectronMainExport(id) {
if (electron[id]) {
return electron[id];
}
let remote = electron.remote;
if (!remote) {
try {
remote = require('@electron/remote');
} catch (originalError) {
const error = new Error(
'Install and set-up package `@electron/remote` to use this module from a renderer processs.\n'
+ 'It is preferable to set up message exchanges for this using `ipcMain.handle()` and `ipcRenderer.invoke()`,\n'
+ 'avoiding remote IPC overhead costs, and one morepackage dependancy.\n\n'
+ 'Original error message:\n\n'
+ originalError.message,
);
error.originalError = originalError;
throw error;
}
}
if (remote && remote[id]) {
return remote[id];
}
throw new Error('Unknown electron export: ' + String(id));
}
const BrowserWindow = getElectronMainExport('BrowserWindow');
const ipcMain = getElectronMainExport('ipcMain');
function electronPrompt(options, parentWindow) {

@@ -33,5 +62,5 @@ return new Promise((resolve, reject) => {

menuBarVisible: false,
skipTaskbar: true
skipTaskbar: true,
},
options || {}
options || {},
);

@@ -62,4 +91,4 @@

nodeIntegration: true,
contextIsolation: false
}
contextIsolation: false,
},
});

@@ -113,10 +142,6 @@

const promptUrl = url.format({
protocol: 'file',
slashes: true,
pathname: path.join(__dirname, 'page', 'prompt.html'),
hash: id
});
promptWindow.loadURL(promptUrl);
promptWindow.loadFile(
path.join(__dirname, 'page', 'prompt.html'),
{hash: id},
);
});

@@ -123,0 +148,0 @@ }

const fs = require('fs');
const {ipcRenderer} = require('electron');
const docReady = require('doc-ready');

@@ -161,2 +160,2 @@ let promptId = null;

docReady(promptRegister);
document.addEventListener('DOMContentLoaded', promptRegister);
{
"name": "electron-prompt",
"version": "1.6.2",
"version": "1.7.0",
"description": "Electron helper to prompt for a value via input or select",

@@ -33,11 +33,9 @@ "keywords": [

"rules": {
"unicorn/prefer-ternary": 0
"unicorn/prefer-ternary": 0,
"unicorn/prefer-module": 0
}
},
"dependencies": {
"doc-ready": "^1.0.4"
},
"devDependencies": {
"xo": "^0.38.2"
"xo": "^0.44.0"
}
}

Sorry, the diff of this file is not supported yet

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