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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:17:15+00:00 2026-05-23T12:17:15+00:00

If I launch a window with a flash game in it, and Chrome’s popup

  • 0

If I launch a window with a flash game in it, and Chrome’s popup blocker suppresses it, the user hears the music from the game, but sees nothing. This is because Chrome doesn’t block the window; it just hides it.

Chrome loads the page to get the favicon and page title, so they can display it in the popup blocker dialog (which you see when clicking the icon in the address bar). But then they don’t close the window. Plugins run, scripts can call back to the opener – it’s like a regular window, but invisible. (Okay, malware developers, please stop drooling.)

Chrome could parse the contents of the <head> tag to retrieve the <title> and favicon <link/> tag without actually loading the page. They could close the hidden window after they’ve retrieved the icon/title. They could just show the URL instead of the icon/title. Instead, the bug continues to fester since 2008…

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

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

Anyhow, the question is: Can I detect when this happens? Perhaps there’s something in the window.chrome JavaScript object to indicate that the window is in this invisible state, so I can close it or remove the flash?

__

Based on Prusse’s answer, here’s what I ended up with…

function isPopupZombie(popWindow, delay) {
    /// <summary>Attempts to detect zombie window "blocked" (hidden) by Chrome (v.8-12, maybe more)</summary>
    /// <param name="popWindow">The popup window object</param>
    /// <param name="delay">Optional delay in ms; Not necessary when called via other delayed event/function</param>
    if (window.chrome && typeof(popWindow) == 'object') {
        if (delay && !isNaN(parseInt(delay)) && delay > 0) {
            window.setTimeout(function () {
                isPopupZombie(popWindow, 0);
            }, delay);
        } else if (typeof(popWindow.opener) == 'object') {
            var w = (popWindow.innerWidth && popWindow.innerWidth > 0) ? popWindow.innerWidth : popWindow.outerWidth;
            var h = (popWindow.innerHeight && popWindow.innerHeight > 0) ? popWindow.innerHeight : popWindow.outerHeight;
            //console.log('_isPopupZombie: ' + w + ' x ' + h);
            return (w === 0 && h === 0);
        }
    }
    return false;
}

function handlePopupZombie(zombieWindow, notify, callback) {
    /// <summary>Tries to close the zombie or alert about Chrome FAIL</summary>
    /// <param name="zombieWindow">Popup window object known to be a hidden but unblocked popup</param>
    /// <param name="notify">true to notify user of hidden window, false to close zombieWindow</param>
    /// <param name="callback">optional function to call, with single argument for zombieWindow</param>
    if (window.chrome && zombieWindow) {
        if (notify === true) {
            // callback or alert
            if (typeof(callback) == 'function') {
                callback(zombieWindow);
            } else if (zombieWindow.opener) {
                zombieWindow.opener.alert("Your popup blocker has hidden a popup window instead of blocking it.\n\nPlease use the icon in the address bar to open the hidden window.");
            }
        } else {
            // try to kill the zombie
            if (zombieWindow.opener && zombieWindow.opener.console) zombieWindow.opener.console.log('Closing zombie window');
            // after close, blocker icon is in address bar, but favicon/title are not in dialog
            zombieWindow.close();
            // optional callback
            if (typeof(callback) == 'function') callback(zombieWindow);
        }
    }
}

So I can do something like…

var popup = window.open(...);

if (typeof(popup) == 'undefined') {
    // handle it
} else if (popup && popup.closed) {
    // handle it
} else if (isPopupZombie(popup, 100)) {
    console.log('popup zombie!');
    handlePopupZombie(popup, true);
} else {
    console.log('no zombies, this is regular ordinary popup code time!');
}
  • 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-05-23T12:17:15+00:00Added an answer on May 23, 2026 at 12:17 pm

    You may try to check the innerWidth, innerHeight, outerWidth and/or outerHeight. When blocked chrome seens to let them at 0. Like:

    window.addEventListener('load', function(){
        var w = window.open('');
        setTimeout(function(){
            if ((w.outerWidth === 0) && (w.outerHeight === 0)){
                alert('blocked!');
            }
            w = null;
        }, 25);
    }, false);
    

    A delay of 0 will not work since for chrome all new windows are created with (0,0) size, only after some time it give some proper size to it.

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

Sidebar

Related Questions

Is there a method to launch an Internet Explorer window from a desktop Icon
I need to launch a modal window from a plugin in a video application.
Ok not exactly ajax. But we launch a modal window, which fires up straigh
When I launch email client from my application, a compose window of email client
I need to be able to launch a browser window from VBA code (that
I created a Flash application that reads POST data from a form. A user
Is it possible to launch a new window in JavaScript using the window.Open function,
I have the following C# code to launch an outlook window. The one think
I launch the following command line (process) from a Windows VC++ 6 program using
I just installed Cygwin and can launch a bash shell from windows, do ls

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.