HighDots Forums  

newbie's popup code question

Javascript JavaScript language (comp.lang.javascript)


Discuss newbie's popup code question in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
newbiegalore
 
Posts: n/a

Default newbie's popup code question - 02-08-2008 , 07: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,
-A


Reply With Quote
  #2  
Old   
Randy Webb
 
Posts: n/a

Default Re: newbie's popup code question - 02-08-2008 , 09:53 PM






newbiegalore said the following on 2/8/2008 7:15 PM:
Quote:
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/


Reply With Quote
  #3  
Old   
newbiegalore
 
Posts: n/a

Default Re: newbie's popup code question - 02-08-2008 , 10:40 PM



On Feb 8, 6:53 pm, Randy Webb <HikksNotAtH... (AT) aol (DOT) com> wrote:
Quote:
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


Reply With Quote
  #4  
Old   
Randy Webb
 
Posts: n/a

Default Re: newbie's popup code question - 02-09-2008 , 12:38 AM



newbiegalore said the following on 2/8/2008 10:40 PM:
Quote:
On Feb 8, 6:53 pm, Randy Webb <HikksNotAtH... (AT) aol (DOT) com> wrote:
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/


Reply With Quote
  #5  
Old   
newbiegalore
 
Posts: n/a

Default Re: newbie's popup code question - 02-09-2008 , 04:25 AM



On Feb 8, 9:38 pm, Randy Webb <HikksNotAtH... (AT) aol (DOT) com> wrote:
Quote:
newbiegalore said the following on 2/8/2008 10:40 PM:



On Feb 8, 6:53 pm, Randy Webb <HikksNotAtH... (AT) aol (DOT) com> wrote:
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.


Reply With Quote
  #6  
Old   
SAM
 
Posts: n/a

Default Re: newbie's popup code question - 02-09-2008 , 06:06 AM



newbiegalore a écrit :
Quote:
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/>

--
sm


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.