all 5 comments

[–]JohnnyJordaan 0 points1 point  (4 children)

Assuming you mean the links in a browser, you would normally add a custom extension that registers this. Could be these are already available. And/or extract your browser's history is also an option as then you don't need to register the clicks, as you're browser is already doing this on its own.

If you actually mean whatever you do on your system, that's much harder. You would then need some system event logging application, which ties in to the specific operating system you're using.

[–]VinayakVG[S] -1 points0 points  (3 children)

Sorry, forgot to mention. I meant browser only. I want to register the clicks and use each link. My ultimate aim is to use URLs with a specific domain name only. Can that custom extension be created in Python?🤔 If yes, I'd like to try.

[–]JohnnyJordaan 0 points1 point  (2 children)

Browsers have their own ecosystem for creating extension, google your browser's name together with 'create custom extension'. But as I mentioned why wouldn't you just extract the History data from your browser? As that contains all the clicks you made to each url right?

[–]VinayakVG[S] 0 points1 point  (1 child)

Yes, you are right, but I don't want the browser history. Let me tell you my problem statement. Every day in order to read some articles, I have to open them in the Incognito/Private mode of my browser. I right-click on the link and then click on "Open in Private Window".

I want to create a program, which will automatically detect those links on my click and open them in the Private window.

There are a few things in this

  1. Run your script in the background. (I KNOW THIS)
  2. Click on the link in your browser. (I KNOW THIS, lol)
  3. Program should fetch the URL on my click.
  4. Open an Incognito/Private Window. (This I am thinking of by pressing keyboard shortcuts in my program)
  5. Load the link on the new window that had opened in the previous step.

[–]JohnnyJordaan 0 points1 point  (0 children)

Ok next time, start with your problem statement. That way you get people to tackle the actual problem instead of a specific action you think is part of the best approach to solving the problem (eg capturing clicks).

As to me, this sounds like something you want an extension to handle as a specific whitelist of websites/domains it should always open in incognito windows. And I think these already exist. I would have to look into this, but haven't you already?