Jquery: Switch focus window in browser by clicking link

Asked

Viewed 80 times

1

Hello, I was wondering if you could do the following: By clicking a link from a site, if I’ve already opened it, this tab becomes the focus, if not, it opens a new tab normally. Thank you!

  • 2

    It is only possible if clicking on the link opens a pop window. If the window was not created by clicking on the link it is created. If you lose focus and click on the link again pop gets the focus.

  • Thank you, I’ll check on that solution.

1 answer

2


This has been possible in the past, in very specific situations. But for security reasons, browsers today prevent this.

If you could shift the focus to another tab, you would probably have total control over it. This would be the nightmare of those who had to guarantee the security of a website of online stores or Internet banking.

You can look for solutions to this in Stack Overflow in English, but I guarantee in advance that:

  • You won’t find an answer that works on all browsers;
  • Probably what you find will already be obsolete and will no longer work.

If you have the need to drastically change what user should view at a given time, then probably changing the tab that the user accesses will not meet your need. It is better to think of other forms of presentation for your application.

  • Thank you for the reply.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.