New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 4158 link

Starred by 6 users

Issue metadata

Status: Verified
Last visit > 30 days ago
Closed: Nov 2008
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

  • Only users with Commit permission may comment.

Sign in to add a comment

Javascript won't open an alert box when run from within a popup window

Reported by, Nov 6 2008

Issue description

Chrome Version       :
Other browsers tested:
     Safari 3: OK
    Firefox 3: OK
         IE 7: OK

What steps will reproduce the problem?
1. Link on web page must invoke Javascript to open a popup window 
containing HTML form and Javascript code for form validation. There is no 
problem in Google Chrome if the link is opened in a new window or tab using 
2. Form validation Javascript code in the popup window invokes 
alert(message) upon encountering an error within the form and sets focus to 
the appropriate form element.

What is the expected result?
Google Chrome should display the alert box.

What happens instead?
Google Chrome will execute all Javascript code EXCEPT for opening the alert 


Comment 1 by *, Nov 6 2008

Labels: -Area-Misc Area-Compat Need-more-info
Could you please provide detail steps/example so that we can reproduce this issue? 

I tried javascript alert box in popup window, Chrome can display the alert box 

Comment 2 by Deleted ...@, Nov 7 2008

same problem here.

Link opening content in pop-up window
<A HREF="javascript:NewWindow

Using this javascript:

<SCRIPT TYPE="text/javascript">
var win = null;
function NewWindow(mypage,myname,w,h,scroll,status){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
= 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+sc
win =,myname,settings)

Confirm and alert javascript now suddenly doesn't work in the popup-vindue when user 
e.g. tries to submit a form that uses a confirm function:

<FORM ACTION=buy_wait.asp METHOD=POST id=form name=form onSubmit="return confirm
('are you sure you want to delete?');">

We hope that you can solve this one out quickly. We have a lot of customers now not 
being able to use our webservice while this issue persists.


Comment 3 Deleted

Having the same issue with our product and confirm/alert dialogs not showing in popup

popup links:
<a onclick="'popup.html', 'test', 'height=470,width=550'); return false;"
target="_blank" href="popup.html">anchor popup</a>
<div onclick="'popup.html', 'test', 'height=470,width=550');">div popup</div>
<input type="button" onclick="'popup.html', 'test',
'height=470,width=550');" value="button popup">

popup.html window code to try an alert() and a confirm():
	<input type="button" value="alert" onClick="alert('alert test');">
	<input type="button" value="confirm" onClick="confirm('confirm test');">

Have tried a slew of features - basically the only way an alert or
confirm will work is if chrome renders the "popup" in a new tab by default which
happens when you include 'menubar=1,status=1,titlebar=1,toolbar=1,scrollbars=1'
chrome will automatically open the "popup" in a tab in the default configuration.

Comment 5 by, Nov 10 2008


I have exactly the same problem.


Have attached two files to illustrate the problem... see zipped attachment.
Just open the file: "start-chrome-popup.htm" first.
2.2 KB Download

Comment 6 by *, Nov 10 2008

Labels: -Need-more-info Has-reduction Chrome-specific JavaScript
Status: Untriaged
The problem is caused by javascript method ", windowName[, 
If the 3rd parameter windowFeatures is specified, then alert box doesn't work in the 
popup constrained window in Chrome, here is a simplified reduction:


If the 3rd parameter windowFeatures is ignored, then alert box works in the popup in 
Chrome(the popup is actually opened as a new tab in Chrome), like this:


it doesn't happen in IE7, Firefox3 or Safari3, it's a chrome specific issue.

See also attachments for simplified reductions
354 bytes View Download
107 bytes View Download
380 bytes View Download
Labels: -Area-Compat Area-BrowserUI Mstone-1.0
Status: Assigned
This looks like a recent regression.
This broke (intentionally) in r2116.

I'm going to revert 2116 from trunk and the release branch. We'll have to revisit the 
original bug with a different approach: this one does not work.

Comment 10 by, Nov 11 2008

Status: Fixed
This should be fixed (with unit tests based on the reductions to prevent this form 
happening again) in r5198. mal directly committed the one line fix in 
onto the release branch earlier.

Comment 11 by Deleted ...@, Nov 14 2008

When will this fix be released?

This will be fixed in 154.22, which should go to the Dev channel next week. The fix 
should make it to the Beta channel before the end of November.
Status: Verified
Verified in the official build Chrome: V - 154.22

Comment 14 by Deleted ...@, Nov 18 2008

I cannot get java to work on Pogo.  What steps do we need to do to fix this?  How do 
we access V-154.22 and is this problem fixed?

Comment 15 by, Nov 18 2008

Chrome will only work with Java 6 Update 10.  You can download that from:

The release is a dev channel only release.  If you're currently not 
subscribed to the dev channel, you might want to consider taking a look.  Information 
about subscribing to the dev channel is here:

Comment 16 by, Nov 18 2008

Good job guys.... 
Tested the (dev channel) and it worked as it should.

Look forward to see this in a public release though.....

Comment 17 by Deleted ...@, Oct 26 2009

Hi According to the above discussions, google chrome used 10 mths later should be 
showing alerts. I am trying today for a website - i have been using alerts to trace the flow of 
the code to take appropriate action, but the alert never happens, neither does the message 
get shown anywhere else.
26th Oct  09.
Any help please? I have some deliverables tomorrow .
9.9 KB View Download

Comment 18 by Deleted ...@, Feb 20 2011

MMM... Chrome, for me the best browser, until I was blocked from some little silly bugs, like the one in this thread, now he has become one of my TEST browser and NOT my DEFAULT BROWSER :-((( ... Why, :-( !
Please correct your browser, my errors are the same of other guys, my relief it's that I aven't done nothing wrong with my code.
Please correct it :-)

My Specs: Windows 7, Chrome 9.0.597.98, webprogrammer Intel Core Duo,NvidiaVGA,4GBram.  

Comment 19 by, Oct 18 2011

I encounter the same problem with the confirm() dialog in Chrome 15.0.874.92 beta-m. 

     onclick="if (!confirm('Are you sure you want to delete this task?')) { return false; };"

I choose Cancel button and the form is submitted... Certainly I have tested this code in other browsers and worked fine in IE9, FF7, Opera11, etc.

Please fix it because I love Chrome and do not want to change it from default browser status.

Thank you and keep your otherwise excellent work.

Project Member

Comment 20 by, Oct 13 2012

Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.

Sign in to add a comment