Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.



dkomo872 schreef:
On Aug 26, 11:59 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@xxxxxxxxxxxxxxxx> wrote:
dkomo872 schreef:



On Aug 26, 11:30 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@xxxxxxxxxxxxxxxx> wrote:
dkomo872 schreef:
On Aug 26, 10:43 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@xxxxxxxxxxxxxxxx> wrote:
dkomo872 schreef:
On Aug 26, 10:09 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@xxxxxxxxxxxxxxxx> wrote:
dkomo872 schreef:
On Aug 26, 2:01 am, Erwin Moller
Firefox comes up with a message saying that it blocked a popup
window. This statement does not open a popup window! It causes a


So basically you are saying Javascript is not allowed to open new
windows with the default popup blocker active in FF?

I made this simple page:

<html>
<head>
<title>blockuptest</title>
</head>
<body>
Hi, click <span onClick="dopopup();" style="color:#00F;">here</span> for
popup.
<script type="text/javascript">
function dopopup(){
window.open("http://www.google.com","googlewindow";); }
</script>
</body>
</html>

My popupblocker in FF is active, I have no exceptions listed.
I uploaded it to my server, and tested there.
It simply opens google in a new window, no questions asked, when I click
'here'.

So I ask you again: Did you TRY it actually or do you simply assume it
won't work?


Ok, I executed

window.open("http://www.google.com","googlewindow";);

in place of my

document.form3.submit();

and got the usual

Bad luck.

I tested it too with a window.setTimeout(), and then it gets blocked too.
However, I was inspired by your remark about clientactions not getting blocked, so I tried the following:

<html>
<head>
<title>blockuptest</title>
</head>
<body>
Hi, click <span onClick="window.setTimeout('dopopup();',100);" style="color:#00F;">here</span> for popup.

<script type="text/javascript">
function dopopup(){
window.open("http://www.google.com","googlewindow";);
}
</script>
</body>
</html>

Which doesn't get blocked.

-----------------------------------------------

However, this version DOES get blocked after the first window:

<html>
<head>
<title>blockuptest</title>
</head>
<body>
Hi, click <span onClick="window.setTimeout('dopopup();',100);" style="color:#00F;">here</span> for popup.

<script type="text/javascript">
var count=0;
function dopopup(){
window.open("http://www.google.com","googlewindow"+count);
count++;
window.setTimeout('dopopup();',1000);
}
</script>
</body>
</html>

So appearantly FF needs a fresh useraction, otherwise it will start blocking again.

-----------------------------------------------
Last silly test, It will invoke the popup on every mouseclick, and that does work.

<html>
<head>
<title>blockuptest</title>
</head>
<body onClick="postingtime(event);">
Hi, click <span onClick="window.setTimeout('dopopup();',100);" style="color:#00F;">here</span> for popup.

<script type="text/javascript">
function postingtime(evt){
var meetingdkomo872criteria = Math.random()<0.9;
if (meetingdkomo872criteria){
dopopup();
}
}

function dopopup(){
window.open("http://www.google.com","googlewindow"+Math.random());
}
</script>
</body>
</html>

I tried with onMouseMove() too, but that DOESN'T work.

--------------------------------------------------

Maybe you can use the last hack, allthough I personally think it stinks hard. (I just wrote it our of curiousity.)
It depends on what it is excactly that triggers your formsubmission (you didn't tell yet) if such an approach is feasable.
Personally I would simply tell my clients that you need to popup, and tell them to unblock it for your site.

I go home now.
Maybe somebody else has some brighter ideas. ;-)
Good luck.

Erwin Moller

--
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
.



Relevant Pages

  • Re: link hover color not honored when using onclick event
    ... It's unlikely he/she/it wants a popup, and likely that their browser or other software will block popups. ... Or they could have Javascript disabled, in which case nothing will happen at all (at least with a popup blocker, they may get a message telling them it's been blocked). ... "email this page" link and purpose here is to produce a clean "popup" style window that lets the visitor still see the current page but fill in the form to send the email. ... You know I have a pop-up blocker running but it does not complain. ...
    (alt.html)
  • window.captureEvents(Event.CLICK) javascript error
    ... I am trying to add an event handler to the window so that If the user clicks ... it creates a popup to tell the user it should use ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Iceweasel freezes and iceape vulnerabilities and instability
    ... popup is fixed in place within the browser window, ... the browser is doing its job; it is just possible to do some really ... Funny you mention this -- I don't think this is due to malicious code, ...
    (Debian-User)
  • RE: [PHP] Conditional popup driven from server-side
    ... otherwise display normal browser page. ... if there aren't errors then popup a modal ... window and start processing while displaying ... server, and then get the server to close it when done. ...
    (php.general)
  • Re: "allow blocked content" bar -- how to disable?
    ... Allow active content to run in files on My Computer - Windows XP Service ... it turns out that it IS the information bar. ... It may be your Popup blocker warning, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)