I have an electron.js app that uses active-win to log the currently opened window. On macOS, this also includes the url of the current window. But, this feature seems to not be supported on any other operating system. I wanted to see if there is a package/way to get the url of the currently opened window if it is a browser so I can log it.
Thanks in advance and sorry if this question has already been asked/answered - I looked online for quite a while and couldn't find any clear solutions.
I've thought about using a browser extension, other npm packages,using windows's accessibility api's, but none seemed to be a great option.
An example output from active-win
{
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', /* this will never show on windows or linux, ie. what I want to recreate in some form*/
memoryUsage: 11015432
}
No - Electron’s packaging system is built upon application micro-packet messaging, meaning the url is parsed into small encrypted bits which cannot reliably be reassembled in the backend.