1

I want the page I opened as a popup with window.open to go to the background after the page is opened. I try window blur but it doesn't work that way. I am novice in this matter. I am waiting for your help.

I am also trying out the Chrome console.

  • 1
    Window blur works as expected. Please show some code, so that we can see what is wrong with it. – Teemu Jul 21 '20 at 08:18
  • var wind = window.open("https://www.google.com","","width=500,height=500,left=1000,top=1000"); I want to open a popup page in this way and send it to the back of the window. I want the window to stay in focus, I want the popup to go behind. How can I do it – Kürşat Yasin Yıldırım Jul 21 '20 at 08:57
  • You can't affect a third-party page with JS. Try to focus on your own page instead. – Teemu Jul 21 '20 at 08:59
  • I want the popup page to go to the background after it is opened. Keep my own window in focus, the popup page goes to the back. Or is there a way to hide the popup page? Can I do with window.blur? How can I help you? – Kürşat Yasin Yıldırım Jul 21 '20 at 09:04
  • Do `window.focus()` after you've opened the pop-up, i.e. set the focus to your own page, don't try to hide the third-party page. – Teemu Jul 21 '20 at 09:08
  • I want Google.com to open the page as a popup and go to the background. The focus should be the main window, the popup window should go to the background. I try Chrome console but I can't. Do you have the opportunity to send samples? I would be glad if you help. – Kürşat Yasin Yıldırım Jul 21 '20 at 09:14
  • 1
    It looks like you can't do this anymore without user's interaction, see https://stackoverflow.com/a/25296462/1169519 . Though the linked article is talking about focusing the pop-up, but by following the provided links, it seems, that focusing any window with JS needs user's interaction. The behavior is behind the browser's options, so you can't rely focusing working for all the visitors on your page, if you set the options of your own browser. A good UX would also not interfere the browser's default actions. If something unexpected happens, a user might quickly navigate away from your page. – Teemu Jul 21 '20 at 09:34

0 Answers0