Coder Social home page Coder Social logo

sindresorhus / active-win Goto Github PK

View Code? Open in Web Editor NEW
728.0 27.0 158.0 2.93 MB

Get metadata about the active window (title, id, bounds, owner, etc)

License: MIT License

JavaScript 38.96% Swift 22.93% TypeScript 4.81% C++ 29.80% Python 3.49%
nodejs javascript active-window

active-win's Introduction

active-win

Get metadata about the active window (title, id, bounds, owner, URL, etc)

Works on macOS 10.14+, Linux (note), and Windows 7+.

Install

npm install active-win

Usage

const activeWindow = require('active-win');

(async () => {
	console.log(await activeWindow(options));
	/*
	{
		title: 'Unicorns - Google Search',
		id: 5762,
		bounds: {
			x: 0,
			y: 0,
			height: 900,
			width: 1440
		},
		owner: {
			name: 'Google Chrome',
			processId: 310,
			bundleId: 'com.google.Chrome',
			path: '/Applications/Google Chrome.app'
		},
		url: 'https://sindresorhus.com/unicorn',
		memoryUsage: 11015432
	}
	*/
})();

API

activeWindow(options?)

Get metadata about the active window.

options

Type: object

accessibilityPermission (macOS only)

Type: boolean
Default: true

Enable the accessibility permission check. Setting this to false will prevent the accessibility permission prompt on macOS versions 10.15 and newer. The url property won't be retrieved.

screenRecordingPermission (macOS only)

Type: boolean
Default: true

Enable the screen recording permission check. Setting this to false will prevent the screen recording permission prompt on macOS versions 10.15 and newer. The title property in the result will always be set to an empty string.

activeWindow.sync(options?)

Get metadata about the active window synchronously.

Result

Returns a Promise<object> with the result, or Promise<undefined> if there is no active window or if the information is not available.

  • platform (string) - 'macos' | 'linux' | 'windows'
  • title (string) - Window title
  • id (number) - Window identifier
  • bounds (Object) - Window position and size
    • x (number)
    • y (number)
    • width (number)
    • height (number)
  • owner (Object) - App that owns the window
    • name (string) - Name of the app
    • processId (number) - Process identifier
    • bundleId (string) - Bundle identifier (macOS only)
    • path (string) - Path to the app
  • url (string?) - URL of the active browser tab if the active window (macOS only)
    • Supported browsers: Safari (includes Technology Preview), Chrome (includes Beta, Dev, and Canary), Edge (includes Beta, Dev, and Canary), Brave (includes Beta and Nightly), Mighty, Ghost Browser, Wavebox, Sidekick, Opera (includes Beta and Developer), or Vivaldi
  • memoryUsage (number) - Memory usage by the window owner process

activeWindow.getOpenWindows()

Get metadata about all open windows.

Windows are returned in order from front to back.

Returns Promise<activeWindow.Result[]>.

activeWindow.getOpenWindowsSync()

Get metadata about all open windows synchronously.

Windows are returned in order from front to back.

Returns activeWindow.Result[].

OS support

It works on macOS 10.14+, Linux, and Windows 7+.

Note: On Windows, there isn't a clear notion of a "Window ID". Instead it returns the memory address of the window "handle" in the id property. That "handle" is unique per window, so it can be used to identify them. Read more…

Linux support

Wayland is not supported. For security reasons, Wayland does not provide a way to identify the active window. Read more…

Electron usage

If you use this package in an Electron app that is sandboxed and you want to get the .url property, you need to add the proper entitlements and usage description.

Users

Related

Maintainers

Development

To bypass the gyp build:

npm install --ignore-scripts

active-win's People

Contributors

ahallicks avatar albinekb avatar ambarvm avatar arciisine avatar bendingbender avatar binyamin avatar braaar avatar fisker avatar ghorbanzade avatar itaisteinherz avatar janealter avatar jlsilva1994 avatar johnharden avatar jyboudreau avatar keheliya avatar kentbetita avatar ljubic avatar miniben-90 avatar multifox200 avatar pityulin avatar richienb avatar robertjkeck2 avatar sindresorhus avatar stanczakp avatar stroncium avatar tiangolo avatar tkainrad avatar uglow avatar wrgoto avatar zigotica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

active-win's Issues

Console log when getting mac window fails

Hey!

I'm constantly having errors thrown when running on mac, which by default is not a problem, but there's a console log which pollutes my running process.
Can it be removed? If someone wants to have the error printed out they can do manually by catching the error. Actually this would mean that the try-catch block is not necessary (since currently it's there only to write the error to the console)

console.error(error);

Get full path to executable

Would it be possible to return the full path to the executable of the currently active application? I'd like to be able to get the icon of the app and don't know of a good way to do this based solely on having the name of the exe.

"SyntaxError: Unexpected end of JSON input" for some of the opened windows

OS: Ubuntu 18.04
version: [email protected]

actual behavior:
the exception is caught and the promise returns undefined
desired behavior
no exception thrown and the module returns correct window details

Exception stack trace SyntaxError: Unexpected end of JSON input at JSON.parse () at parseLinux (/home/igorb/projects/trackabi-desktop-app/node_modules/active-win/lib/linux.js:48:15) at module.exports (/home/igorb/projects/trackabi-desktop-app/node_modules/active-win/lib/linux.js:97:16)
xprop result: _NET_WM_ICON_GEOMETRY(CARDINAL) = 5, 147, 54, 54 _BAMF_DESKTOP_FILE(STRING) = "/usr/share/applications/google-chrome.desktop" _NET_FRAME_EXTENTS(CARDINAL) = 1, 1, 28, 1 WM_STATE(WM_STATE): window state: Normal icon window: 0x0 _NET_WM_DESKTOP(CARDINAL) = 0 _NET_WM_STATE(ATOM) = _NET_WM_STATE_FOCUSED _NET_WM_USER_TIME(CARDINAL) = 6098738 WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified location: 100, 100 program specified minimum size: 1 by 1 WM_NAME(UTF8_STRING) = "devtools://devtools/bundled/js_app.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/@5f4eb224680e5d7dca88504586e9fd951840cac6/&dockSide=undocked" _NET_WM_NAME(UTF8_STRING) = "devtools://devtools/bundled/js_app.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/@5f4eb224680e5d7dca88504586e9fd951840cac6/&dockSide=undocked" XdndAware(ATOM) = BITMAP _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x1, 0x0, 0x0 _NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_STICK, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW _NET_WM_ICON(CARDINAL) = Icon (128 x 128):
                                                        ░░░░░░░░░░░░░░░░                                                        
                                                  ░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░                                                  
                                              ░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░                                              
                                            ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                                            
                                         ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                                         
                                       ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                                       
                                     ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                                     
                                   ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                                   
                                 ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                                 
                                ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                
                              ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                              
                             ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                             
                           ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                           
                          ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░                          
                         ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                         
                        ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                        
                       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                       
                      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                      
                     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                     
                    ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                    
                   ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                   
                  ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                  
                 ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                 
                 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                 
                ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                
               ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░               
              ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒               
              ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░              
             ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░             
             ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒             
            ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░            
            ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒            
           ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░           
           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                 ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░           
          ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░           
          ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░           
         ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                             ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░          
         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░             ░░░░░░             ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                  
         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░          ░░▒▒▒▒▒▒▒▒▒▒░░           ░░░░░░░░░░░░░░                                
        ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░         ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░          ░░░░░░░░░                                    
        ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░        ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░         ░░░░                                        
       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░        ░                                          
       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░        ░                                         
       ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░       ░                                         
       ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░       ░                                        
      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                               
      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░      ░                                       
      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                              
      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░      ░                                      
      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                             
      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                            
     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                            
     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                           
     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                           
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                           
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                           
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                          
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                          
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                          
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                          
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                          
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                          
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                           
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                           
     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                           
     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                           
     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                            
     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░     ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                            
      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                             
      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                             
      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                              
      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                              
      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░      ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                               
       ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                
       ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                 
       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                  
       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░       ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                   
        ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒         ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░        ░                                            
        ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒          ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░         ░░                                            
        ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░          ░░▒▒▒▒▒▒▒▒▒▒░░          ░▒                                             
         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░             ░░░░░░             ░▒░                                             
         ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                              ▒▒▒                                              
          ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                          ░▒▒▒░                                              
          ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                      ░▒▒▒▒▒                                               
           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                 ░░▒▒▒▒▒▒                                                
           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░        ░░░▒▒▒▒▒▒▒▒░                                                
            ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                                 
            ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                 
             ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                                  
             ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                  
              ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                    ░              
              ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                                    
               ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                    
                ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                    ░                
                 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                   ░                 
                 ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                                      
                  ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                      
                   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                                       
                    ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                   ░                    
                     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                  ░                     
                      ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                  ░                      
                       ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                 ░                       
                        ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                                 ░                        
                         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                                                          
                          ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                               ░                           
                           ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                               ░                            
                             ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                              ░                             
                              ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                             ░                               
                               ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                            ░                                
                                 ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                           ░                                  
                                   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                         ░░                                   
                                     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                        ░░                                     
                                       ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                       ░░                                       
                                         ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░                     ░                                          
                                           ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                   ░░                                            
                                              ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░               ░░                                                
                                                  ░▒▒▒▒▒▒▒▒▒▒▒           ░░░                                                    
                                                       ░░░▒▒▒░░░░░░░░░                                                          

_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 2
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 77594733, 77594734
WM_WINDOW_ROLE(STRING) = "pop-up"
WM_CLASS(STRING) = "google-chrome", "Google-chrome"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_PID(CARDINAL) = 5441
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "igorb-notik"
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, _NET_WM_PING, _NET_WM_SYNC_REQUEST

The exception occurs when trying to JSON.parse theresult['_NET_WM_NAME(UTF8_STRING)'] variable with following line inside, which is obviously truncated:

"devtools://devtools/bundled/js_app.html?remoteBase

Meanwhile the original line is:

_NET_WM_NAME(UTF8_STRING) = "devtools://devtools/bundled/js_app.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/@5f4eb224680e5d7dca88504586e9fd951840cac6/&dockSide=undocked"

As seen above the line contains multiple = characters. However this case was not covered in the processOutput() function:

const processOutput = output => {
	const result = {};

	for (const row of output.trim().split('\n')) {
		if (row.includes('=')) {
			const [key, value] = row.split('=');
			result[key.trim()] = value.trim();
		} else if (row.includes(':')) {
			const [key, value] = row.split(':');
			result[key.trim()] = value.trim();
		}
	}

	return result;
};

Some problem about V8?

nodejs version: v14.2.0
os: windows

do i need to use version 12 of nodejs?

when i first run code in readme, i got some fatal error
PS D:\Code\shortCutHelper> node main.js

#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: 00000011208FC050
 1: 00007FF6C591CEDF v8::internal::wasm::DisjointAllocationPool::~DisjointAllocationPool+74383 2: 00007FF6C5857BEF std::basic_ostream<char,std::char_traits<char> >::operator<<+55439       
 3: 00007FF6C641E432 V8_Fatal+162
 4: 00007FF6C5EE73AD v8::internal::BackingStore::Reallocate+653
 5: 00007FF6C6112B09 v8::ArrayBuffer::GetBackingStore+137
 6: 00007FF6C58E2F98 v8::internal::Malloced::operator delete+15784
 7: 00007FF6C58E79F5 node::Buffer::Length+1813
 8: 00007FF6C58E80B3 node::Buffer::New+163
 9: 00007FF6C58ED886 napi_create_external_buffer+230
10: 00007FF96066C0C9 FFI::WrapPointer<_ffi_type>+137 [D:\Code\shortCutHelper\node_modules\ffi-napi\src\ffi.h]:L37
11: 00007FF960670636 FFI::FFI::InitializeBindings+3718 [D:\Code\shortCutHelper\node_modules\ffi-napi\src\ffi.cc]:L117
12: 00007FF96066F5A0 Init+64 [D:\Code\shortCutHelper\node_modules\ffi-napi\src\ffi.cc]:L304
13: 00007FF96066C01B Napi::details::WrapCallback<<lambda_8c7377a71108815b2eee34f099f4cb99> >+43 [D:\Code\shortCutHelper\node_modules\node-addon-api\napi-inl.h]:L104
14: 00007FF96066A36B __napi_Init+59 [D:\Code\shortCutHelper\node_modules\ffi-napi\src\ffi.cc]:L309
15: 00007FF6C58ECD0B node_module_register+5691
16: 00007FF6C58EA0C3 node::Buffer::New+7427
17: 00007FF6C58EA982 node::Buffer::New+9666
18: 00007FF6C60D5E3F v8::internal::Builtins::builtin_handle+330191
19: 00007FF6C60D53CE v8::internal::Builtins::builtin_handle+327518
20: 00007FF6C60D56C7 v8::internal::Builtins::builtin_handle+328279
21: 00007FF6C60D5513 v8::internal::Builtins::builtin_handle+327843
22: 00007FF6C61B356D v8::internal::SetupIsolateDelegate::SetupHeap+466093
23: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
24: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
25: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
26: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
27: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
28: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
29: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
30: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
31: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
32: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
33: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
34: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
35: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
36: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
37: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
38: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
39: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
40: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
41: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
42: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
43: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
44: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
45: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
46: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
47: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
48: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
49: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
50: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
51: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
52: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
53: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
54: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
55: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
56: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
57: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
58: 00007FF6C614B708 v8::internal::SetupIsolateDelegate::SetupHeap+40520
59: 00007FF6C61492EE v8::internal::SetupIsolateDelegate::SetupHeap+31278
60: 00007FF6C6148EDC v8::internal::SetupIsolateDelegate::SetupHeap+30236
61: 00007FF6C602CDEF v8::internal::Execution::CallWasm+1743
62: 00007FF6C602C5FF v8::internal::Execution::Call+191
63: 00007FF6C61061A7 v8::Function::Call+615
64: 00007FF6C58EEFFF napi_unref_threadsafe_function+2543
65: 00007FF6C58F2B97 node::Start+1159
66: 00007FF6C58F2F91 node::Start+2177
67: 00007FF6C593BF38 node::LoadEnvironment+56
68: 00007FF6C587FBE3 EVP_CIPHER_CTX_buf_noconst+39939
69: 00007FF6C58F2830 node::Start+288
70: 00007FF6C57566FC RC4_options+339452
71: 00007FF6C666782C v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+156812
72: 00007FF99B827BD4 BaseThreadInitThunk+20
73: 00007FF99D52CE51 RtlUserThreadStart+33

here is my package.js

{
"dependencies": {
"active-win": "^6.1.0"
},
"devDependencies": {},
"name": "shortcuthelper",
"version": "1.0.0",
"main": "main.js",
"scripts": {},
"author": "",
"license": "ISC",
"description": ""
}

Support of Node 14

Hello,
Is there any plans to support node 14 ?
#71 had an issue with v14 too.
No rush, just to know if it was planned 😊

Get url from browser

Any way we can get URL from a browser? At the moment it is getting the title of a webpage pretty accurately but I need the URL for my purposes.

app:"Google Chrome"
id:122
pid:1053
title:"New Issue · sindresorhus/active-win"

Provide Windows information without FFI

I'm currently using this module in a vscode plugin, and platform specific binaries are complicated to handle. I was looking at some powershell scripts what should be able to produce the necessary information, and was wondering if you would be open to a PR that removed the use of ffi.

active-win showing error while running electron application

currently I am using active-win in my electron 5 with Angular 8 application, while running the application it showing error "Module not found error"

WARNING in ./node_modules/iconv/build/Release/iconv.node 1:0
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

ERROR in ./node_modules/iconv/lib/iconv.js
Module not found: Error: Can't resolve '../build/Debug/iconv.node' in '/Users/manikandan/Documents/Projects/MyTry/electron-testing/timetracking-poc/node_modules/iconv/lib'

active-win doesn't work on Windows 32 bits (because of fastcall). Should we change to node-ffi (as it does work)?

Here's the issue in fastcall. By the owner comments, it seems like is not something easy or fast to solve.

In that issue is described the procedure to reproduce it, I won't copy all the steps here, they include downloading a free Windows 7 32 bit virtual machine, etc.


Also, fastcall uses cmake-js, which is a "not so standard" way to build a Node extension. So, for example, to support Electron we would have to change the README to include those instructions for a cmake-js dependent package. That's not a big deal, it can be done, but could be somewhat cumbersome for users, as we would have to explain what is happening. (Assuming we just remove support for Windows 32 bits).

But because of that same only package.json configuration, we couldn't support other ways of building the package, for example with electron-builder. It rebuilds all the dependencies for x64 and for ia32 automatically, using the needed runtime (Electron), and then packages both in a single installer, but it wouldn't be able to do that for a cmake-js dependent package, as it would have to have the configurations in the package.json. This problem would be the next to happen assuming that the first issue was solved and cmake-js / fastcall gave support for Windows 32 bit systems.

My intention was to include cmake-js support into electron-builder, here: cmake-js/cmake-js#83 and here: electron-userland/electron-builder#1516 .

But I won't be able to continue with that plan, as I can't even test it, because of that first issue above.


Meanwhile, I created a branch, and I changed all the fastcall code to node-ffi, and:

  • It works in Windows 32 bits too.
  • It can be built by electron-builder automatically, supporting a single installer for 64 and 32 systems (it can be built in a 64 bit Windows machine and support 64 and 32 bits).
  • It doesn't require the users to add a special section in their package.json to be able to use this package.

I tested it all with that VM procedure described above.


What do you think about changing active-win back to node-ffi instead of fastcall?

My opinion is that the speed improvement is not that a big deal for this specific package, it is not doing computationally expensive operations.

But I do think that it would be a plus giving better support for some OSes (Windows 32 bits), better support for Electron and similar tools right out of the box and support for electron-builder including building a single installer for both architectures.

I can PR my branch at https://github.com/tiangolo/active-win/tree/ffi . It's the one I'm using right now, as I need those features.

Can't detect active window in a service

We have developed some app using active-win library. Then used nssm (https://nssm.cc) to enable app work in background. But it could not detect active window. What is wrong, how to make it run ? Why it could not detect foreground window when app is windows service ?

Trigger an event when focus changes

I imagine it would be something like:

const activeWin  = require('active-win');

activeWin.on('change', win => {
    console.log(win.title);
});

With win being the same as activeWin() returns.

No idea how to achieve this though as it would have to communicate with the binary somehow. Maybe spawn the native binary when someone subscribes to the events, and have the binary push to stdout for each event.

PR welcome 😀

Is there some sort of window id parent <-> child relationship going on?

When I have a PHPStorm window active, active-win gives me the id of 96469000 but if I try to use that with navigator.webkitGetUserMedia it fails.

If I use desktopCapturer.getSources({ types:['window'] }, function(error, sources) { from this require const {desktopCapturer} = require('electron'); the id comes back as 96469861 which does work correctly with navigator.webkitGetUserMedia.

In addition another instance of PHPStorm has the same id from active-win (96469000) but a different id from desktopCapturer.getSources 96469057.

I'm guessing there's some sort of parent <-> child relationship between windows? Is there a way I can use the active-win id to get the correct "child" id I need so I can pass it into navigator.webkitGetUserMedia?

I'm running Ubuntu 16.04, using node 7.9.0, Chrome 58.0.3029.110, and Electron 1.7.8

Error: dydl Library not loaded. Reason: Image not found

Hello, I'm trying to use this module in an Electron App but it raises an exception:

dyld: Library not loaded: @rpath/libswiftAppKit.dylib
  Referenced from: /Users/js/Code/node-window-test/node_modules/active-win/main
  Reason: image not found

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:198:13)
    at Pipe._handle.close (net.js:606:12)

Also, I tried to create a simple test.js file with the following:

const activeWin = require('active-win');

(async () => {
	console.log(await activeWin());
	/*
	{
		title: 'Unicorns - Google Search',
		id: 5762,
		bounds: {
			x: 0,
			y: 0,
			height: 900,
			width: 1440
		},
		owner: {
			name: 'Google Chrome',
			processId: 310,
			bundleId: 'com.google.Chrome',
			path: '/Applications/Google Chrome.app'
		},
		memoryUsage: 11015432
	}
	*/
})();

Then I installed the package with npm i active-win.

But when I run:

node test.js the same error is shown.

Am I missing something?

I'm running macOS mojave 10.14.1.

Please help me, thank you very much.

Silently fails under Linux if xwininfo/xprop is missing

Fails without further notice if xprop or xwininfo because they are either not installed, or not present in the PATH variable. If you ask me the promise should fail with a proper error when something fails (or throw an Error for the sync variant). The current behaviour makes debugging the root of the problem quite difficult.

active-win/lib/linux.js

Lines 109 to 111 in 430e6ef

} catch (_) {
return undefined;
}

Also you might want to add that there is no Wayland support at the moment to the documentation especially considering the increasing popularity of Wayland.

I might PR this myself when I find the time.

Feature: Able to get active window other properties like positions & states

It would be nice if this module can also get current windows positions & states.

{
  title: 'npm install',
  id: 32,
  app: 'Terminal',
  pid: 64,
  position: { top: 128, left: 256, bottom:568, right:320 },
  state: 'Maximized'
}

To change the states we can have something like activeWin.state(['minimized', 'maximized', 'normal', 'close']);, and to move current window we can have something like activeWin.move(t,l,b,r);.

Install the python dependency

Hello,

I am new to node and I am trying to get the active windows on a Windows OS. I presume in Linux and Mac, the python package is automatically installed but in Windows, it isn't. I see that one of the dependencies ffi-napi has a python dependency.

I want to know if there is any command that can automatically install the python dependency and configure that so the active windows will work. Any help would be really great.

Unable to install as npm package

I am trying to do a npm install of this package and I am getting this error.

E:\Projects\JS\Electron\macro-recorder>npm install active-win

> [email protected] install E:\Projects\JS\Electron\macro-recorder\node_modules\iconv
> node-gyp rebuild


E:\Projects\JS\Electron\macro-recorder\node_modules\iconv>if not defined npm_config_node_gyp (node "C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB4025: The project file could not be loaded. Root element is missing.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Users\\vkkpp\\AppData\\Local\\nvs\\node\\8.14.0\\x64\\node.exe" "C:\\Users\\vkkpp\\AppData\\Local\\nvs\\node\\8.14.0\\x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Projects\JS\Electron\macro-recorder\node_modules\iconv
gyp ERR! node -v v8.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

> [email protected] install E:\Projects\JS\Electron\macro-recorder\node_modules\ref-napi
> node-gyp rebuild


E:\Projects\JS\Electron\macro-recorder\node_modules\ref-napi>if not defined npm_config_node_gyp (node "C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB4025: The project file could not be loaded. Root element is missing.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Users\\vkkpp\\AppData\\Local\\nvs\\node\\8.14.0\\x64\\node.exe" "C:\\Users\\vkkpp\\AppData\\Local\\nvs\\node\\8.14.0\\x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Projects\JS\Electron\macro-recorder\node_modules\ref-napi
gyp ERR! node -v v8.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

> [email protected] install E:\Projects\JS\Electron\macro-recorder\node_modules\ref
> node-gyp rebuild


E:\Projects\JS\Electron\macro-recorder\node_modules\ref>if not defined npm_config_node_gyp (node "C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB4025: The project file could not be loaded. Root element is missing.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\vkkpp\AppData\Local\nvs\node\8.14.0\x64\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Users\\vkkpp\\AppData\\Local\\nvs\\node\\8.14.0\\x64\\node.exe" "C:\\Users\\vkkpp\\AppData\\Local\\nvs\\node\\8.14.0\\x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\Projects\JS\Electron\macro-recorder\node_modules\ref
gyp ERR! node -v v8.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\iconv):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\ref-napi):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\ref):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
added 3 packages from 3 contributors, updated 1 package and audited 513 packages in 53.907s
found 0 vulnerabilities


E:\Projects\JS\Electron\macro-recorder>

First I got an error stating the node gyp was not able to find the python 2.7 so I installed python 2.7 inn c/python27 and then when i tried again i got this error.

Fresh install of the package shows errors:

Hi Wondering if you can assist with these errors, I've had a google about it and there doesn't seem to be resolves for windows.

  • Cannot open include file: 'get-uv-event-loop-napi.h': No such file or directory in node_modules
    \ffi-napi\build\ffi_bindings.vcxproj

  • hundreds of these errors:
    warning C4311: 'type cast': pointer truncation from 'char (*)[16]' t
    o 'long' (compiling source file ..\deps\libiconv\lib\iconv.c

I'm not sure what's going on, removing the active-win package removes these errors.

Add missing properties on Linux and Windows

Issuehunt badges

Would be nice to have better consistency between the platforms.

The Linux implementation is missing:

  • bounds
  • memoryUsage
  • owner.path

And the Windows implementation is missing:

  • bounds
  • memoryUsage

// @tiangolo @ahallicks @keheliya @itaisteinherz

IssueHunt Summary

stroncium stroncium has been rewarded.

Sponsors (Total: $50.00)

Tips

Unable to get the activeWin working

Dev mode.......... electron
Quasar theme...... mat
Quasar CLI........ v0.17.23
Quasar Framework.. v0.17.19
Debugging......... enabled

app:quasar-conf Reading quasar.conf.js +0ms
app:dev Checking listening address availability (0.0.0.0:8080)... +3ms
app:webpack Extending Renderer process Webpack config +263ms
app:webpack Extending Main process Webpack config +1ms
app:generator Generating Webpack entry point +5ms
app:dev-server Booting up... +1ms

Renderer process █████████████████████████ [100%] in ~8s
Main process [0%]

ERROR Failed to compile with 1 errors 17:44:35

This relative module was not found:

  • ../build/Debug/iconv.node in ./node_modules/iconv/lib/iconv.js

active-win working in electron 7 but not in electron 8

Hello,

I have been using this library for a while now but after updating to electron 8 it has completely stopped working. Have you had a chance to use the library with electron 8? I would simply uninstall electron 8 and re-install electron 7 but for some weird reason after installing 8 downgrading to 7 causes reloading (ctrl+r) electron to produce a white screen. Reloading works find on 8.

Below is the error message I receive when I run let win = await activeWin(); on an electron 8 app.
[1] before active-win [1] [1] [1] # [1] # Fatal error in , line 0 [1] # ignored [1] # [1] # [1] # #FailureMessage Object: 000000050F10BE50wait-on http://localhost:3000 && electron . exited with code 3

On Ubuntu Linux, when Chrome is the active window, there is no "Window ID"

On Ubuntu Linux, when Chrome is the active window, there is no "Window ID".

This is the error I get in my terminal:

[16:39:54:0424] [error] TypeError: Cannot read property 'split' of undefined
    at parse (/media/user/DATA/internal-project/node_modules/active-win/index.js:35:51)

I got more details in my Sentry:

id: parseInt(result['WM_CLIENT_LEADER(WINDOW)'].split('#').pop(), 16),

Then I modified the module in place to output to the console the full stdout and found out that Chrome doesn't seem to have that property (although the terminal did).

I will submit a PR to fix this, returning null instead (as with the window title).

insight.io不能浏览该项目

请教一个问题,我安装了insight.io来阅读gihub上的项目,有的项目不能用这个插件,显示 insight not included yet,这是仓库的问题还是因为其它啊? 我发现几个含有中文的项目都不能用,这是因为项目中含有中文?

Error when active app does not have a window (macOS)

Repro Steps

  1. Set a timeout that runs activeWin()
  2. Open Finder
  3. Close window but do not select another window
  4. Wait for activeWin() to run

Expected: The call returns the app without the window information.

Actual: The call fails with the following error:

SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at parseMac (.../node_modules/active-win/lib/macos.js:10:15)
at
(node:2458) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Error parsing window data

Error while running in electron app in windows

I've encountered with some error in windows. Below given is the npm log.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;H:\Projects\my-app\electron-ui\node_modules.bin;C:\Program Files\Python38\Scripts;C:\Program Files\Python38;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;G:\softwares\Yarn\bin;C:\Program Files\Git\cmd;C:\Users\dev.windows-build-tools\python27;C:\Users\dev.windows-build-tools\python27;C:\Users\dev.windows-build-tools\python27;C:\Users\dev\AppData\Local\Microsoft\WindowsApps;F:\softwares\IntelliJ IDEA Community Edition 2019.1.2\bin;;C:\Users\dev\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\dev\AppData\Roaming\npm;C:\Users\dev\AppData\Local\Yarn\bin;C:\Program Files\MongoDB\Server\4.2\bin;
9 verbose lifecycle [email protected]start: CWD: H:\Projects\my-app\electron-ui
10 silly lifecycle [email protected]
start: Args: [ '/d /s /c', 'cross-env NODE_ENV=development electron .' ]
11 silly lifecycle [email protected]start: Returned: code: 3 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: cross-env NODE_ENV=development electron .
13 verbose stack Exit status 3
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid [email protected]
15 verbose cwd H:\Projects\my-app\electron-ui
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v12.13.0
19 verbose npm v6.12.0
20 error code ELIFECYCLE
21 error errno 3
22 error [email protected] start: cross-env NODE_ENV=development electron .
22 error Exit status 3
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3, true ]

Cannot run in production mode

Hi all,
I have a small piece of code that runs in development mode, but when running in production the following line gives an error. Is this related to Mac permissions on Catalina?
var active = (await activeWin())

Gives >
child_process.js:308 Uncaught (in promise) Error: Command failed: /Applications/electron-webpack-quick-start.app/Contents/Resources/app.asar.unpacked/node_modules/active-win/main

Thanks a lot

Cannot install module

>> npm install active-win

> [email protected] install C:\Users\PragmaticEd\workspace\_private\clipboard-manager\node_modules\iconv
> node-gyp rebuild


C:\Users\PragmaticEd\workspace\_private\clipboard-manager\node_modules\iconv>if not defined npm_config_node_gyp (node "C:\develop\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\develop\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: D:\develop\Python3.7.2\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\develop\\nodejs\\node.exe" "C:\\develop\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\PragmaticEd\workspace\_private\clipboard-manager\node_modules\iconv
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

> [email protected] install C:\Users\PragmaticEd\workspace\_private\clipboard-manager\node_modules\ref-napi
> node-gyp rebuild
>> python --version
Python 3.7.2
>> npm -v
6.4.1
>> node -v
v10.15.0

Windows 10 1809 b17763.316 Pro Official

active-win not working after release :c

Hello,

I'm pretty new at Electron and I created a software where everything works out when I use your library in debug mode.

  • npm install active-win
  • npm start

However, when I decide to create an exe file for Windows 64 bits, i can affirm that the following require line doesn't work (I debugged my code hard) :
const activeWin = require('active-win') // not working...

I don't catch any error though and it's just blocking the rest of my JavaScript code.

I used electron-packager to generate the production release :
"win64": "electron-packager . --overwrite "MyApp" --out=dist/win64 --platform=win32 --arch=x64 --icon=./assets/build/win/icon.ico --prune=true --asar=true --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="MyApp""

Please, can you tell me if I need some dependencies to use this library in release mode ?

Thanks in advance.

active-win giving me an error right after installing and using sample code.

I tried using this code in my electron app:

// In Renderer Process
const activeWin = remote.require('active-win');
activeWin().then(result => {
  console.log(result);
});

after installing active-win with this command:

$ npm install --save active-win

and I got this error:

Error: Could not call remote function ''. Check that the function signature is correct.
Underlying error: Cannot find module 'ffi'

Any suggestions on how to fix it?

Error: Cannot find module 'ffi'

I have installed active-win via npm install --save active-win and I am receiving the following error on a fresh nodeJS project as soon as I run the Usage Example.

OS: Windows 10
NodeJS: v8.9.0

    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (c:\Users\me\Desktop\TMP\active-win\node_modules\active-win\lib\windows.js:4:13)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)```

Mention in the docs to include "postinstall": "install-app-deps"

Basically I spent two days fiddling around with the package, hitting errors like this when running it in Electron on Windows:

Error: error: 1114\\?\D:\path\to\project\node_modules\ref\build\Release\binding.node at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20) at Object.Module._extensions..node (module.js:598:18) at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at bindings (D:\path\to\project\node_modules\bindings\bindings.js:76:44) at Object.<anonymous> (D:\path\to\project\node_modules\ref\lib\ref.js:5:47)

along with a localized message that a DLL initialization routine would have failed.

I finally found out the package worked fine after I had built an Electron release package once, which finally led me to including "postinstall": "install-app-deps" in the "scripts" section of my package.json.

Granted, I'm an absolute NodeJS/Electron beginner and more experienced devs (or the smart ones using the Electron boilerplate) might not run into this issue, but I certainly would have appreciated a mention of this in the docs.

Refactor

I think it would be cleaner now if the code was split up into a lib folder for each OS:

  • lib/macos.js
  • lib/linux.js
  • lib/windows.js

Where each expose an interface of exports.async and exports.sync. index.js would then only be responsible for delegating to the correct OS functions.

Browser URL Functionality

I'd love to add functionality mentioned in #45 and #54. I know #54 suggests using node-applescript but it is actually quite easy to add the AppleScript functionality to the existing Swift file in active-win. I've already tested a few ways to include the active URL in the returned JSON and could submit a PR if you'd entertain it. If not, I can just make a separate package!

Avoid triggering access dialogs on macOS

How to Avoid triggering access dialogs on macOS?

i found that there is a pull request into the branch but why its not getting merged, as its giving alot of popup for accessibilities & screenshots

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.