A fortune cookie slip

Get a life.  And then write about it. What'd you last do on the project? What'd you last do on the project? Dude, you are *so* clueless.  I have to tell you all about your cluelessness. Get a life.  And then write about it. Get a life.  And then write about it. Get a life.  And then write about it. I've got to get out of here.  Can you send me somewhere else? I feel compelled to read more, but all there is old stuff. Diaryland is da bomb Current | Archives | Contact Me
Related Links | My Personal Journal | Diaryland


�Closing a parent window with Javascript considered harmful�
2002-01-02, 16:00:00
:


Okay, this is not right. It bodes poorly for the future of popup ads, too.


Ever wanted to pop up a child window, say, of your site (perhaps chromeless, even) and then close the parent window that pulled it?

We did at work for a project using the intranet. I was asked how we do this. I dug, and found out that this bit o' Javascript works:

parentwin = window.self; � � � � � // Make handle for current window named "parentwin"
parentwin.opener = window.self; � �// Tell current window that it opened itself
parentwin.close(); � � � � � � � � // Close window's parent (e.g. the current window)

It's so obvious that this is a bad idea, I never considered it. But it works.


Consider this - you go to a site from a search engine. The script sees you come from the site with a given search string, and decides to embed a javascript that pops up an ad window and closes your current window. Or given some other magic and the insecurity of javascript, all your other windows.

This is similar in level of evil to "smart links" in IE6.

Lord help us. The apocalypse is upon us.



2013-03-01

Suckage

2007-01-09

Want to connect to MSN with PHP?

2005-04-11

AtoZed Software's Indy installer *sucks*

2005-01-10

Another thing I don't like about Altiris

2004-10-25

One of the (many) joys of having your own server


Search this site: