newbie's popup code question

N

newbiegalore

Hi everyone :) ,
I searched the forum to look for an answer to
my query but did not find a match. I'm trying to write a small script
which would be able to identify whether a site is using pop ups or
not. Could someone please let me have a pointer as to what I should be
looking for in the code?

Looking for tags like <SCRIPT LANGUAGE="JavaScript">, and for
function, window.open, onload might be able to tell me that the site
used popups. Is there a better way to to do this. If anyone knows of a
tool/script which can identify popup code inside the HTML source,I
would greatly appreciate any info about it.

Thanks in advance,
-A
 
N

newbiegalore

newbiegalore said the following on 2/8/2008 7:15 PM:
Hi everyone :) ,
I searched the forum to look for an answer to
my query but did not find a match. I'm trying to write a small script
which would be able to identify whether a site is using pop ups or
not. Could someone please let me have a pointer as to what I should be
looking for in the code?
Looking for tags like <SCRIPT LANGUAGE="JavaScript">, and for
function, window.open, onload might be able to tell me that the site
used popups. Is there a better way to to do this. If anyone knows of a
tool/script which can identify popup code inside the HTML source,I
would greatly appreciate any info about it.
Thanks in advance,

No need to look for <script> as the code doesn't have to be in a script
block. onclick="window.open(this.href)" in a link is one example.

Searching for window.open may not suffice either as you can break up the
call by assigning a reference to window and then using winRef.open or
they could be using window['open']('someURL')

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/

So then if there are a large number of ways to "obfuscate" the call to
make a new window, is there a common call which all of these
approaches make? I mean that if they all call a window-open event or
use a library to do so can I detect it using ld? Sorry if my question
seems a bit lame..I'm an absolute n00b with JS.

What's the generic way for a pop-up blocker to understand that a pop-
up is trying to open up?

Thanks.
-A
 
N

newbiegalore

newbiegalore said the following on 2/8/2008 10:40 PM:


newbiegalore said the following on 2/8/2008 7:15 PM:
Hi everyone :) ,
I searched the forum to look for an answer to
my query but did not find a match. I'm trying to write a small script
which would be able to identify whether a site is using pop ups or
not. Could someone please let me have a pointer as to what I should be
looking for in the code?
Looking for tags like <SCRIPT LANGUAGE="JavaScript">, and for
function, window.open, onload might be able to tell me that the site
used popups. Is there a better way to to do this. If anyone knows of a
tool/script which can identify popup code inside the HTML source,I
would greatly appreciate any info about it.
Thanks in advance,
No need to look for <script> as the code doesn't have to be in a script
block. onclick="window.open(this.href)" in a link is one example.
Searching for window.open may not suffice either as you can break up the
call by assigning a reference to window and then using winRef.open or
they could be using window['open']('someURL')
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
So then if there are a large number of ways to "obfuscate" the call to
make a new window, is there a common call which all of these
approaches make? I mean that if they all call a window-open event or
use a library to do so can I detect it using ld? Sorry if my question
seems a bit lame..I'm an absolute n00b with JS.
What's the generic way for a pop-up blocker to understand that a pop-
up is trying to open up?

Any of them are going to try to intercept a call to window.open,
determine if it was user initiated or not, and let the call be issued.
Some of the more aggressive blockers simply redefine the window.open
method and make it impossible to open a new window. Some are capable of
intercepting target="new_window" type attributes on links and force it
into the current window.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/

Thanks for the great tips :). I found http://www.webmasterworld.com/forum91/4090.htm
which provides some more info regarding what you have said..I'll try
to figure it out.
 
S

SAM

newbiegalore a écrit :
Thanks for the great tips :). I found http://www.webmasterworld.com/forum91/4090.htm
which provides some more info regarding what you have said..I'll try
to figure it out.

All what you have to know is that visitors can have fixed their
navigator to open a html blank window or a JS popup in :
- another tab (with/without jupping to it)
or
- same window (same tab)
and some bad popup's blockers could display nothing.

If you however use window.open(); have a look here :
<http://developer.mozilla.org/en/docs/DOM:window.open>
<http://developer.mozilla.org/en/docs/DOM:window.open#FAQ>
<http://www.gtalbot.org/DHTMLSection/WindowEventsNS6.html>
and don't resize (nor size) your popup since it can be in the main window.

It's why we see now most of advertisements appearing in false-windows
somewhere in front of the displayed page in same window.
<http://jquery.com/demo/thickbox/>
<http://www.huddletogether.com/projects/lightbox2/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,093
Latest member
Vinaykumarnevatia00

Latest Threads

Top