Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popups, popup killers, & js 1

Status
Not open for further replies.

RenoWV

Technical User
Mar 16, 2002
156
US
I know that different "popup killer" programs have different parameters regarding what they affect. Some do only unrequested popups; some do all popups; some do all popups & new windows too.

So as a generalization, does anyone know if alert boxes are considered to be popups, and are thus affected by these programs?

If the answer to that is "no" (ie, alerts ARE allowed), then is it possible to create a javascript that will detect whether or not popup killing software is in use?

Depending on what it finds, it could launch an alert box saying something like "Alert! This site uses extensive javascript and includes user requested popup windows".

May be well beyond the capabilities of js, but if it were possible, would be an immensely useful script, now that popup killers are becoming more popuplar.

Does anyone have an insight about whether or not this can be accomplished?
 
hmmm. Try this.


<script>
popWin = window.open(&quot;&quot;, &quot;test&quot;,&quot;height=20,width=20&quot;)

if (popWin){
popWin.close()
}
else{
alert(&quot;Enable pop windows&quot;)
}
</script> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Very creative approach mwolf00 -- thank you.

If anyone who is using popup killer software can test mwolf00's script (and report back to the forum), we'll determine for sure if we have an effective method for alerting visitors about this aspect of a site's interface...
 
ne4x4 - did you get the alert message? Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
With the popup killer enabled no. With it disabled i get a pop up window opening in the browser. then it closes.

Ive done a bit more investigation with the popup killer program, it has 2 modes natural and strict. The natural mode seems to work in a similar way to most firewalls ie it learns as it goes. In strict mode it just stops every type of pop up window
even
<a href=&quot;JavaScript:popWindow01()&quot; name=&quot;pop1&quot; >click here</a>
types as well as std <href=&quot;assite.com&quot; target=&quot;_blank&quot;>
Hope this helps
Ian It's not a lie if you believe it!

 
It really stops all alert boxes! Or maybe, it kills the pop after javascript creates it (which circumvents my code). Can you try a simple alert box?

<script>
alert(&quot;It Works&quot;)
</script> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
I also have the FreeSurfer Popup Killer installed on IE 5.5, and got the same exact results as ne4x4. I really like this popup killer as it does allow the user requested popups. When I first ran your script, I wasn't sure whether FS was picking it up (I was wondering for example if FS was allowing all popups that are launched from within the local page), so that is why I also asked others to check.

I just uploaded a test page with the script to:


Your second alert test worked perfectly -- that is, the &quot;It Works&quot; alert did launch as intended.
 
Its a shame really because pop up windows have their uses it's just that they have been over exploited by bad sites and getme rich quick web cowboys.
Just a thought and I'm not sure if its's possible but freesurfer is a browser plugin (I assume the others are as well), I seem to remember seeing somewhere that it was possible to get plugin info from the navigator object.
It may just be possible therefore to
check navigator for plugins, if popupkiller exists(need to find out how to identify them)
then document.write('This site uses popup windows as part of its functionality etc')

regards
Ian

It's not a lie if you believe it!

 
I'm simply amazed that you can't use an alert box with a popup blocker! What does this give you???

<script>
popWin = window.open(&quot;&quot;, &quot;test&quot;,&quot;height=20,width=20&quot;)

if (popWin){
popWin.close()
}
else{
document.write(&quot;Enable pop windows&quot;)
}
</script> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
<script>
popWin = window.open(&quot;&quot;, &quot;test&quot;,&quot;height=20,width=20&quot;)

if (popWin.closed){
document.write(&quot;Enable pop windows&quot;)}
else{
popwin.close()
}
</script>
Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Using the

document.write(&quot;Enable pop windows&quot;)

in your &quot;I'm simply amazed..&quot; post, I got the same results as ne4x4;

using the second suggested script, I get an error message:

Line 13 Character 3 'popwin is undefined'

plus the popup box stayed in place...
 
I was just checking to see in the error reporting alerts still worked [wink]. There has to be a way to detect the popup blocker...

poptest.htm
<script>
window.opener.test.testBool.value = &quot;true&quot;
self.close
</script>


main.htm
<script>
popWin = window.open(&quot;poptest.htm&quot;, &quot;testWin&quot;,&quot;height=20,width=20&quot;)

function checkWin(){
testVal = document.test.testBool.value
if (testVal == &quot;true&quot;){
document.write (&quot;No blocker&quot;)
else{
document.write (&quot;Blocker&quot;)
}
}

<body onLoad=&quot;checkWin()&quot;>
<form name=&quot;test&quot;>
<input name=&quot;testBool&quot; value=&quot;false&quot;>
</form>
Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
hmm there seems to be an error in the script. Looks as if its in the poptest script which I placed in poptest.htm

I get the following report
window.opener.test is null or not an object

this obviously screws up the other script
It's not a lie if you believe it!

 
Oops! the page hasn't loaded yet!

main.htm
<script>
function wait(){
//wait a sec
checkWin2()
}
function checkWin2(){
testVal = document.test.testBool.value
if (testVal == &quot;true&quot;){
document.write (&quot;No blocker&quot;)
else{
document.write (&quot;Blocker&quot;)
}
}
function checkWin(){
popWin = window.open(&quot;poptest.htm&quot;, &quot;testWin&quot;,&quot;height=20,width=20&quot;)
setTimeout(&quot;wait()&quot;,100)
}

<body onLoad=&quot;checkWin()&quot;>
<form name=&quot;test&quot;>
<input name=&quot;testBool&quot; value=&quot;false&quot;>
</form>
Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
OK - so I'm losing it! Why did I write the function &quot;wait()&quot;???? I could've set the timeOut on checkWin2() and skipped that wasted bit of code.... Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Will check it in a moment just been back to freesurfer site to see if I could gleen any info the only thing i could find was
How does Free Surfer mk II work?
Free Surfer uses fs20 inference chain engine. The rules of engine is easily updateable. That's why fs20 engine is continuously evolving and getting better and better.
Regards
Ian It's not a lie if you believe it!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top