Getting information about the active window and process (title, description, path, processId, url)
Works on Windows.
npm i https://github.com/pityulin/devart-active-win.git --save-optional
const activeWindow = require('devart-active-win');
(async () => {
console.log(await activeWindow(options));
/*
{
title: "Google - Google Chrome",
platform: "windows",
owner: {
processId: 9064,
path: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
name: "Google Chrome",
},
url: "https://www.google.com/",
}
})();
Type: object
Type: boolean
\
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) -'windows'
title
(string) - Window titleowner
(Object) - App that owns the windowname
(string) - Name of the app or descriptionprocessId
(number) - Process identifierpath
(string) - Path to the app
url
(string?) - URL of the active browser tab if the active window is Google Chrome, Microsoft Edge, Firefox, Opera Internet Browser, Vivaldi
It works only on Windows 7+.