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 7820877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:27:43+00:00 2026-06-02T07:27:43+00:00

I have this generic javascript function to open a window: function OpenWindow(url,windowname,wide,high) { spop=window.open(url,windowname,width=+wide+,height=+high+,scrollbars=1,resizable=1,statusbar=1,menubar=0);

  • 0

I have this generic javascript function to open a window:

function OpenWindow(url,windowname,wide,high)
{
    spop=window.open(url,windowname,"width="+wide+",height="+high+",scrollbars=1,resizable=1,statusbar=1,menubar=0");
    spop.moveTo(Math.round((screen.availWidth-wide)/2),Math.round((screen.availHeight-high)/2));
    spop.focus();
}

After opening it, I move it to the middle of the screen.
The problem is that Chrome is currently hiding the opened window (it works fine in Explorer and Firefox). It opens it, moves it, but then the windows stays minimized and unaccesible.

The funny thing is that if I double click on the link that calls the function, then the window appears where it should, only that its size and height are incorrect (it’s very small, and I hav to resize it). Even funnier, is that it used to work in Chrome, but stopped working a couple of months ago.

Apaprently the problem is not the focus() call (I have found people having issues with it). If I remove the moveTo(), the window appears (but not centered).

Any ideas?
Thanks!

  • 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-02T07:27:46+00:00Added an answer on June 2, 2026 at 7:27 am

    It turns out this is a known bug in the current version of Chrome:

    http://code.google.com/p/chromium/issues/detail?id=115585

    It seems the fix is to delay any calls to resizeTo or moveTo after calling open, for example:

    setTimeout(function(){
        spop.moveTo(
            Math.round((screen.availWidth - wide) / 2),
            Math.round((screen.availHeight - high) / 2)
        );
        spop.focus();
    },100);
    

    Not the most elegant solution, but it should suffice until the bug is fixed.

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

Sidebar

Related Questions

I have a generic JavaScript function which takes one parameter function foo(val) { ...}
I have this code (C#): using System.Collections.Generic; namespace ConsoleApplication1 { public struct Thing {
I have this method to get a generic repository out of a dictionary: public
I have this simple example: using System; using System.Collections.Generic; namespace ConsoleApplication1 { class Program
I have a generic method with this (dummy) code (yes I'm aware IList has
I have a generic list. Some elements of this list belong to a parent
Say that i have a generic dictionary with data like this (I hope the
I have a generic class that takes a type T . Within this class
I have a urlpatterns like this: urlpatterns = patterns('', ... (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict, 'poll_detail'),
In my base class I have a generic method (ideally this would be a

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.