Click to See Complete Forum and Search --> : popupblocker check befor entering a webpage
Hello together, i have a prob with my webpage which is generated in a popup format. There are no dialers or something like this, it is only to secure the content.
If someone is useing a popupkiller prog and enters my page, the page will be closed without any information.
I want to change this.
The Idea is to create a infopage first, whitch is able to check if someone is useing a popup killing prog.
So there must be a popup first created. If this would be able to load, i think there is no popup killing software and it could be closed. Then a normel rediretion could be implemented and ready.
But when the popup is not loaded, there should be a message in the index page, to shut down the popup killing software.
My problem is that i am not able to create a script like this.
I´m a non programmer.
I even don´t know if it would be possible to write such a script.
Please let me know, if someone is able to do so or someone know if such a script exists.
sorry for my bad english!
Khalid Ali
07-08-2003, 01:55 PM
to find out if a popup window is open or cloed..
var popupWin = window.open("some.html","popupWin");
now if the window is opened
popupWin will not be null at this point
if(popupWin @=null & !popupWin.closed){
//popup opend
}else{
//either popup is null or its been closed
}
requestcode
07-08-2003, 02:07 PM
You can't kill their popup killer program. That would defeat the purpose of having one. You should either redesign your page or have a link on an info page that will load the page into the current window.
@requestcode
Don´t want to kill this prog.
Want to inform the visitor of my webpage to shut down his software otherwise he would not be able to view the site.
@Khalid Ali
Thank you for your information, but i am not able to write the code completly so could you give me an complete example?
What mußt i write into the index.htm
I think to close the popup i can use a timer or selfeclose script?
will not work....
Beginner at work... please help!
-------------------------------------
<script language="Javascript">
<!--
var popupWin = window.open("test.htm","popupWin","height=680,width=930,left=50,toolbars=no,scrollbars=yes,resizable=yes");
if(popupWin @=null & !popupWin.closed)
{
document.location = "enter.htm"
}
else
{
document.location = "no_enter.htm"
}
//-->
</script>
---------------------------------------
Script should look like...
<<if popup will be created , close it an go to enter page...
if popup will not be created go to infopage....>>
What´s wrong ....
<script language="JavaScript">
<!--
var popupWin = window.open("test.htm","popupWin);
if(popupWin==null || popupWin.closed || !popupWin)
{
alert("please shut down popupkiller prog....");
}
//-->
</script>
noone out there to fit this problem?
Khalid Ali
07-10-2003, 10:58 AM
Its tough to debug unles some one has that popup killer rogram installed and see wha thappens ,from the looks of the code it should work theonly thing you may want to do is ad a timer,that will put some delay between the window.opoen event and then testing if it exists,to give browser time to make sure the window had been closed by the program
setTimeout()
freefall
07-10-2003, 11:02 AM
Be patient! The second one, you forgot a "
<script language="JavaScript">
<!--
var popupWin = window.open("test.htm","popupWin");
if(popupWin==null || popupWin.closed || !popupWin)
{
alert("please shut down popupkiller prog....");
}
//-->
</script>
And the one before that had a couple errors:
<script language="Javascript">
<!--
var popupWin = window.open("test.htm","popupWin"," height=680,width=930,left=50,toolbars=no,scrollbars=yes,resizable=yes");
if(popupWin !=null && !popupWin.closed)
{
document.location.href = "enter.htm"
}
else
{
document.location.href = "no_enter.htm"
}
//-->
</script>
- ian
Cool, this works with the IE ... but not with the opera Browser.
You can say opera to ignore popups. So i did, and nothing happened...
What mußt be changed?
Vladdy
07-10-2003, 11:46 AM
Just a thought on the topic....
You'd get much better responses, if you asked "How can I implement this feature WITHOUT using popups" ...
I bet 90% of your visitors would rather leave the site than disable their popup blocker.
@ Vladdy
yes, may be, but i have my reasons to do so...
--------------------------------------------------------
@ freefall
@ Khalid Ali
I integrated a timeout.... everything works fine, but opera says also nothing when "blocking is on".
...
<script language="Javascript">
<!--
function test()
{
var popupWin = window.open("test.htm","popupWin"," height=680,width=930,left=50,toolbars=no,scrollbars=yes,resizable=yes");
if(popupWin !=null && !popupWin.closed)
{
document.location.href = "enter.htm"
}
else
{
document.location.href = "no_enter.htm"
}
}
window.setTimeout("test()",3000);
//-->
</script>
...
--------------------------------------------
"test.htm" will be closed by this...
...
<script LANGUAGE="JavaScript">
setTimeout("self.close();", 3000);
</script>
...
--------------------------------------------
After a test with a activ popupblocker ...
the Browser (IE) allways links to the enter.htm.
why?
freefall
07-10-2003, 04:13 PM
maybe try setting a timeout before checking to see if the popup's closed... 2 seconds or so before you redirect, the killer program might be slower the the script, I don't know
- Ian
I know what you mean, but i don´t know how this looks like...
I´m not a professional in coding, could you show it to me?
freefall
07-10-2003, 04:55 PM
This appears to work. I set the timeout value to 10 seconds in testing and when the popup came, I closed it. It forwarded to the no_enter.html page. That's a good sign =)
<script language="Javascript">
<!--
var popupWin = window.open("test.htm","popupWin"," height=680,width=930,left=50,toolbars=no,scrollbars=yes,resizable=yes");
function test()
{
if(popupWin !=null && !popupWin.closed)
{
document.location.href = "enter.htm"
}
else
{
document.location.href = "no_enter.htm"
}
}
window.setTimeout("test()",100);
//-->
</script>
- Ian
but this is not right...
I need the popup to check if opera or some other browser are able to open the popup also when a popupkiller prog is running.
If the popup does not apear (what we have to check), then i need the no_enter.htm as an info page, that the rest of my page can not be shown with a blocker prog or something like that.
else the enter.htm
look at this:
http://www.hackstube.de/test/test.htm
freefall
07-10-2003, 10:43 PM
I tested this with a friend's popup killer, it allows 2 seconds instead of 1 to check if the popup is still alive. If not, it redirects people with a popup killer to the no_enter page, if the popup is still open, it directs them to the enter page. If this isn't what you want, I don't understand.
<script language="Javascript">
<!--
var popupWin = window.open("test.htm","popupWin"," height=680,width=930,left=50,toolbars=no,scrollbars=yes,resizable=yes");
function test()
{
if(popupWin !=null && !popupWin.closed)
{
document.location.href = "enter.htm"
}
else
{
document.location.href = "no_enter.htm"
}
}
window.setTimeout("test()",200);
//-->
</script>
- Ian
ok, i understand.
What killer prog does your friend use?
I´m asking because for example my opera browser does nothing if i tell him not to allow popups.
Only the start page is open and nothing else happens...
but when i look at the script the "no-enter.htm" should open, or not?
Why does this script not work with the opera browser?
Here is my Link. Try it with opera an you will see...
http://www.hackstube.de/test/test.htm
freefall
07-11-2003, 08:52 AM
Alright, let me downlaod opera, i'll be with you in an hour or so
freefall
07-11-2003, 09:39 AM
It appears like Opera eliminates the entire <script> tag where it finds a popup window! That really sucks! So here is your script modified to adapt to this, works in NN, IE, and Opera.
<script type="text/javascript">
<!--
var popupWin = window.open("test.htm","popupWin","height=680,width=930,left=50,toolbars=no,scrollbars=yes,resizable=yes");
//-->
</script>
<script type="text/javascript">
<!--
function test()
{
if(popupWin !=null && !popupWin.closed)
{
document.location.href = "enter.htm"
}
else
{
document.location.href = "no_enter.htm"
}
}
window.setTimeout("test()",200);
//-->
</script>
Cheers,
Ian
Woh...
this works perfect....
If i ever will have a prob with some code, now i know how will fit it.... :)
!!"RESPECT"!!
I would give very much if i could script like you...
Thank you
freefall
07-11-2003, 04:52 PM
Any time, glad I could help!
www.degreethree.com (http://www.degreethree.com) - Degree Three Design
- Ian Paterson