Electron tools for creating Windows widgets that are fixed to desktop. This package provides features for widget creation of your Electron application.
- [Windows, macOS] Prevent
BrowserWindowfrom being hidden in ShowDesktop. - [Windows] Prevent
BrowserWindowfrom being minimized. - [Windows] Prevent
BrowserWindowfrom being hidden in AeroPeek. - [Windows] Prevent changes in the
BrowserWindoworder. - [Windows] Move
BrowserWindowto the bottom of the windows.
This package uses ffi-napi, so you must meet the ffi-napi requirements before installation.
npm i electget
Electget is available in the Electron main process.
import electget from 'electget';
function createWindow() {
const win = new BrowserWindow({
title: 'Electget Test',
height: 600,
width: 800,
});
loadWindow(win);
// [Windows] Prevent BrowserWindow from being hidden in AeroPeek.
electget.preventFromAeroPeek(win);
// [Windows, macOS] Prevent BrowserWindow from being hidden in ShowDesktop.
electget.preventFromShowDesktop(win);
// [Windows] Prevent changes in the BrowserWindow order.
electget.preventChangeZOrder(win);
// [Windows] Move BrowserWindow to the bottom of the windows
electget.moveToBottom(win);
return win;
}winBrowserWindow - Target BrowserWindow object.
BrowserWindow is fixed to the bottom without being minimized.
Apply moveToBottom, preventChangeZOrder, preventFromShowDesktop at once.
winBrowserWindow - Target BrowserWindow object.
Cancel of alwaysOnBottom method.
winBuffer|BrowserWindow - Target BrowserWindow object or Buffer returned by getNativeWindowHandle.
Prevent BrowserWindow from being hidden in AeroPeek.
winBuffer|BrowserWindow - Target BrowserWindow object or Buffer returned by getNativeWindowHandle.
Prevent BrowserWindow from being hidden in ShowDesktop and minimized.
winBuffer|BrowserWindow - Target BrowserWindow object or Buffer returned by getNativeWindowHandle.
Cancel of preventFromShowDesktop method.
winBrowserWindow - Target BrowserWindow object.
Returns function - Cancel of preventChangeZOrder method.
Prevent changes in the BrowserWindow order.
winBrowserWindow - Target BrowserWindow object.
Returns function - Cancel of preventChangeZOrder method.
Cancel of preventChangeZOrder method.
winBuffer|BrowserWindow - Target BrowserWindow object or Buffer returned by getNativeWindowHandle.
Move BrowserWindow to the bottom of the windows.
Because Webpack bundles the source code, the following error occurs when Webpack is used for the main process: Error: No native build was found ...
You can install the webpack-node-externals package and remove the node package from the bundle with the Webpack externals setting as follows:
// webpack.config.js
const nodeExternals = require('webpack-node-externals');
module.exports = {
...
externals: [nodeExternals()],
...
}- Method failure check.
- Add MacOS support.
- Add test code.