Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@xxxxxxxxxxxxxxxx>
- Date: Wed, 26 Aug 2009 21:15:34 +0200
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 MollerFirefox 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
.
- Follow-Ups:
- References:
- Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: dkomo872
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: Erwin Moller
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: dkomo872
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: Erwin Moller
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: dkomo872
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: Erwin Moller
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: dkomo872
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: Erwin Moller
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: dkomo872
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: Erwin Moller
- Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- From: dkomo872
- Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- Prev by Date: Re: Privileged constructor members
- Next by Date: Simple affair to make money
- Previous by thread: Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- Next by thread: Re: Firefox inappropriately blocks (as a "popup") a form submission using javascript on a web page I'm developing.
- Index(es):
Relevant Pages
|