Get active browser tab URL using electron

I want to get url from an active tab of a browser(could be chrome or firefox or any ) in electron. Any ideas how can I do it?

A browser would not make that information available to an outside program that could be malware for all the browser knows.

There are some desktop apps which are able to monitor the browser activity(i. e. toggldesktop) I wanted to do similar, using Electron framework

If you can find open-source code to do that, you can.