Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8823347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:19:55+00:00 2026-06-14T06:19:55+00:00

The new question On Google Chrome, I can only focus() windows if an element

  • 0

The new question

On Google Chrome, I can only focus() windows if an element has been clicked.

The original question

How can I focus() to a window using javascript, of which the popup window wasn’t created inside the same window I’m using to focus the webpage

var wnd = window.open("http://bing.co.uk", "stage");

Works fine for modifying popup windows that have been opened from a different webpage.

wnd.focus();

However this does not work as the stage window was already open, when the webpage with the wnd focus function was open.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:19:56+00:00Added an answer on June 14, 2026 at 6:19 am

    Answer to your original question:

    If you know that a window with that name exists, you can get a reference to it from a later call to window.open (e.g., when you want to call blur or focus):

    window.open("", "theWindowName").focus();
    

    But of course, if the window doesn’t already exist, that will open a new window. Sadly, you can’t know in advance (except in your application logic) whether a window with that name already exists.

    Once you have the window object, you can call blur or focus.

    Live Example | Source


    Answer to your completely different, new question:

    On Google Chrome, I can only focus() windows if an element has been clicked.

    If your code opened the window, you should be able to. For example:

    HTML:

    <button id="btnOpen">Open</button>
    <button id="btnFocus">Focus</button>
    

    JavaScript:

    jQuery(function($) {
      $("#btnOpen").click(function() {
        window.open(
          "about:blank",
          "theWindow",
          "width=500,height=500");
      });
      $("#btnFocus").click(function() {
        // Note that this happens a full second later, NOT
        // in direct response to a user event
        setTimeout(function() {
          window.open("", "theWindow").focus();
        }, 1000);
      });
    });
    

    Live Example | Source

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im new on Google Chrome Extensions coding, and i have some basic questions. I
I have been asked to post a new question about how to correctly sort
Maybe it has been asked somewhere, but I am trying to find my question
Why doesn't initial page focus doesn't change input field to Green on Google Chrome?
I am trying to attempt my first Google Chrome Extension and have a question.
New Question I am looking for a way in Javascript to get the parent
Related to my question here but not enough to open a new question. I
I'm sorry for opening a new question, I had to - as I wrote
I just figured this out but instead of splitting my new question (why?) into
EDITED SO THE CODE IS CORRECT (THANKS TO ta.speot.is) - NEW QUESTION AT BOTTOM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.