I have an electron app in which i am using Auto Hot key.I want to disable ALT+F4 for that i have written following script
!F4::Return
After execution of this script i am still able to close my electron app using Alt+F4 but for other application like for Notepad,folder etc script is working fine.
For reference: https://www.autohotkey.com/docs/AutoHotkey.htm
This disabled Alt+F4 for all windows with "- Notepad" in the title
SetTitleMatchMode 2 ; All #If statements match anywhere in title
#IfWinActive - Notepad
!F4::return
#IfWinActive
Replace - Notepad with the title of your Electron app's window
I think your probably better off setting closable: false in your browser window options so that the electron window won't close and the other windows won't close.
All browser window options
Related
I am using this in electron to open an application and it works fine.
Here is the code:
require('electron').shell.openExternal('"C:\\Program Files (x86)\\myApplication\\myApp.exe"');
My issue is that it opens in front of my main application.
Is there a way of making it minimize?
You can't minimize the external app, but you can bring the opened app to background by setting activate option to false.
shell.openExternal('pathOrUrl', {activate: false});
The only problem is that it will only work on macOS.
On other operating systems, you can focus on your app's window after opening the external link, but it does not always work.
window.focus();
// or
window.webContents.focus();
Electron Docs
I'm using something like
child_process.exec('start cmd.exe /K bash -c "some commands..."')
to start a terminal. Everything works fine. Of course the terminal opens as a separate window. Is there a way to embed this terminal in the main app window?
There are probably multiple ways to achieve this. One would be using something like xterm. Microsoft Visual Studio Code uses it I believe.
From their description:
Xterm.js is a terminal front-end component written in JavaScript that
works in the browser.
It enables applications to provide fully featured terminals to their
users and create great development experiences.
I'm creating a launcher using electron. It launches applications and files in my Windows system using the shell.openExternal command.
It works well when I call shell.openExternal passing .lnk shortcuts as parameters, but when I call some apparently equal shortcuts created by, for example, GoG installers, the game is not launched and I can't debug what happens. I know that the shortcut is called but the target application crashes. I got this message from Lichdom: Battlemage launcher:
Witcher 3 also fails, nos message is displayed. When I call these shortcuts directly from the system, they work fine. If I manually create an apparently exact same shortcut to the same file, it launches normally in both electron and the explorer.
Any ideas what could be happening or how to debug?
I am using Nodewebkit for creating a simple Desktop application and I have integrated CKEditor in it.
Currently facing some issues with CKEditor in app in "MAC only" which crashes app(Closes app currently).
Steps to reproduce bug:
Open CKEditor in app
Type few words and make it bold
After press of two enter keys, it closes app (Crashes).
This is happening when user clicks on Bold/Italic/Underline Icon only and also happends only when .app file is created.
While testing locally by running GULP, it works without crashing application.
Is there any way I can fix this issue?
Thanks in Advance
Update: App will crash only if HTML Encoding is used. But if HTML Encoding is not done, then it shows special symbols for enter key pressed.
I am running tests from phpunit using selenium. Since the tests take a couple of minutes proceed, I would like to switch to another desktop and do some tasks while the tests are running in the background.
However, since every test calls a new browser via selenium remote server, and a new test management window and a application window are started, these new windows do not appear in the desktop which I started the php tests from, but in my current desktop taking the focus away from the window I am working in.
How can I control that the browsers are always opens in the desktop that is in the background (where I start phpunit)? I am using Kubuntu i.e. the KDE Desktop.
Thanks for any suggestions!
This is probably a bit late, but for anyone reading this: When you launch your selenium RC server, you could try exporting to a specific display using the command:
export DISPLAY="somedisplay" && java -jar /path/to/selenium-server.jar
Using this, you could also export it to for instance an X virtual frame buffer (Xvfb), effectively running it in the background.