When I try to use the executeJavaScript function in my electron app, it works, but brings up the app. How can I make it run in the background.
Related
I'm wondering if there is a way to see UI changes in an iOS application without having to restart the device or simulator. I know in react native since they use Javascript you're able to make a change to the background colour of a view and the background would reflect that change without having to restart the simulator. So I'm thinking since react native just converts javascript into native app code this might be possible in Native Development? Yes no maybe?
Doing normal native iOS development in the typical way -- no.
But, if you reproduce what ReactNative is doing (defining a data format for UI, loading it, and then wiring it up dynamically), then you can re-create it.
You might want to look into SwiftUI, which gives you a way to preview in Xcode without running the entire app.
Without that, if you use modules for all your UI code, you could incorporate a playground and see live changes as you code as well.
I'm just wondering if there is an easy way to have my app extension attached to debugger after the containing app is launched. So right now I hit run button then go to Debug menu and attach my process. Is there a way to automate this process to have my app extension attached after I run the containing app?
At the moment there are no other solutions than the one mentioned in the question
The Electron framework from GitHub has a feature that lets you automatically update your app by using some server utility called Squirrel. What I am wondering is whether an Electron app can simply just update itself without depending on any server utility. Since an Electron app is basically a web-based app using HTML and Javascript, couldn't you just create an "empty" app that has no UI or code other than some bootup Javascript code that downloads the entire UI and other scripts to run the app?
In Electron,
I need to call an external program to do some work, wait for it to finish and terminate, and then move on to my next line of code.
I've tried shell.openItem("/applications/apptocall.app")
This works to launch the app, but it runs the next line of code in my electron app immediately instead of waiting for the externally launched app to finish.
What is the easiest way to do this?
The shell.openItem command of the Electron API is not meant to control the execution of external executables.
Instead, check out the node.js API for child_process.execFileSync (Docs).
There are certain limitations when using the child_process API along with ASAR archive packaging in Electron concerning fs.stats and child_process.spawn, you should read up on these issues here.
Is it possible to show the dev tools within a built electron app? The executable that I built using electron-packager is behaving differently from the app run using electron at the command line, and I have no way to see what kinds of exceptions are being thrown.
Yes it's possible to show the DevTools in a packaged app, just call someBrowserWindow.webContents.openDevTools(). If you want a menu item and/or keyboard shortcut to do it then you'll need to create and set your own menu for the browser window using someBrowserWindow.setMenu(someMenu).