electron

Is it possible to drag a remote file out of Electron App onto the file system?

試著忘記壹切 提交于 2019-12-03 17:11:24
I have been playing around with the file system drag and drop functionality of Electron apps and haven't had any issues getting everything to work with local files. I have not come across anything in the documentation, so I'd like to see if anyone knows if this is possible. I'd like to use the drag-out feature in Electron to drag a remote file outside of the app and onto the file system. Specific example: The program I am working on is a remote file management tool - similar to dropbox. I'd like to drag the dom element representing the remote file to a Finder (or Windows Explorer) window and

Electron Packager - set App Icons for OSX & Windows

大城市里の小女人 提交于 2019-12-03 16:25:27
问题 I am building my electron application with electron packager for windows and OSX platform. package.json: "build": "electron-packager . $npm_package_productName --out=dist --ignore='^/dist$' --prune --all --icon=icon.icns" I run my build process with npm run build . Question: How can I use the electron packager script in my package.json to set the windows AND osx Icon? Problem: The above script sets the app icon for OSX only. It doesnt set the icon for the windows app (NPM throws failure).

Electron app. Multiple html files

时光怂恿深爱的人放手 提交于 2019-12-03 16:23:27
I have an electron app with multiple html files in the root directory. index.html page1.html page.html I cannot find a way to redirect from index.html to page1.html once Electro has started. Does anyone know how to do this? When your first page is index.html you call that page, when you create your window. const win = new BrowserWindow(options); win.loadUrl(`file://${__dirname}/index.html`); If you want to load another page maybe win.loadUrl(`file://${__dirname}/page.html`); could help you. If the page should be loaded after a user action (e.g. click on a link). You can add the link to your

Using Protractor in Electron

Deadly 提交于 2019-12-03 15:14:36
I am trying to set up unit tests and e2e tests for an application I have running with Electron using Protractor . I've been refering to many different posts ( this one did help), but I still get an error I don't understand : Message: Error while waiting for Protractor to sync with the page: "angular could not be found on the window" Stacktrace: undefined My conf.js file looks like this: exports.config = { directConnect : true, seleniumAddress: 'http://localhost:4444/wd/hub', baseUrl:"file://home/me/workspace/testing-project/main.js", capabilities: { browserName: "chrome", chromeOptions: {

Saving desktopCapturer to video file in Electron

拟墨画扇 提交于 2019-12-03 14:15:49
问题 The desktopCapturer api example shows how to write a screen capture stream to a <video> element. // In the renderer process. var desktopCapturer = require('electron').desktopCapturer; desktopCapturer.getSources({types: ['window', 'screen']}, function(error, sources) { if (error) throw error; for (var i = 0; i < sources.length; ++i) { if (sources[i].name == "Electron") { navigator.webkitGetUserMedia({ audio: false, video: { mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId:

Electron app with protractor end-to-end testing

安稳与你 提交于 2019-12-03 13:33:43
问题 I'm currently working on an Electron app and I now want to integrate end-to-end testing with Protractor. I've reviewed the tutorials for Protractor and am now trying to adapt it to Electron. Since Electron runs as a standalone app, how do I do this? It seems that Protractor stands-up a Selenium server that then tries to reach out to an available HTTP server and run tests such as click here, what url am I on, input this text, etc. Therefore how would I go about allowing the selenium server

Access a MySQL Database in Electron

放肆的年华 提交于 2019-12-03 12:22:55
I am using Electron to create an app, and wanted to get to select and insert/update some table in a MySQL Database in my localhost, how can I make the connection with the Database ? PS: I am very new to Electron Thank you for your help. Shawn Rakowski Electron is the combination of Chromium, the web renderer used in Chrome, and Node.js. Adding Node.js to the mix gives Electron the ability to work with the native OS in ways normal web pages cannot. With Node.js at your disposal you have access to all the libraries that are currently available to Node, and so the answer to this question is the

Bootstrap: Uncaught TypeError: Cannot read property 'fn' of undefined

99封情书 提交于 2019-12-03 12:10:47
问题 I am trying to make an Electron application with Bootstrap. I get this error message: Uncaught TypeError: Cannot read property 'fn' of undefined at setTransitionEndSupport (bootstrap.js:122) at bootstrap.js:199 at bootstrap.js:201 at bootstrap.js:9 at bootstrap.js:10 My dependencies in the package.json are: "dependencies": { "bootstrap": "^4.1.2", "electron": "^2.0.5", "jquery": "^3.3.1", "popper.js": "^1.14.3" } My index.html file is: <!DOCTYPE html> <html> <head> <meta charset="UTF-8">

Cross Domain Ajax Call in Atom Shell

删除回忆录丶 提交于 2019-12-03 12:06:11
We are working with Atom Shell (Currently known as electron ) to wrap a web application as desktop app and having trouble making cross domain ajax calls due to CORS restriction. We also tried nw.js (Formerly known as Node-Webkit) and we had no problem making cross domain ajax call with it. Is Atom Shell (Electron) restricts cross domain calls by default ? Lionep If the webpage is loaded in "file://" mode and not served by an http server, you can make ajax calls by default. If you still have troubles with CORS restrictions, you can set this option to the browser-window object : var

How can I take persistent permissions in electron app?

﹥>﹥吖頭↗ 提交于 2019-12-03 12:02:57
I am creating an electron app where I need to scan and update files which need root permission. I know I can run such commands using sudo.exec() in that way: sudo.exec ("rm /private/var/log/fsck_hfs.log", options, (e, stdout, stderr) => {}); And even I can put multiple commands in a script and execute them with single sudo.exec(). In my case, commands needs to be executed at different point of time and I cannot execute them with a single script. It is annoying for user to grant permissions again and again. I tried to do it another way (to run a piece of code where everything that require root