Your generous donations help keep this site online! Click here to support
Hijacking a FWP's Advertising Popup
Some FWPs now are inserting their popup ads into members' pages in such a way that they can't be foiled with <noscript> tags or other tried-and-true popup ad killers (e.g. they are putting the code at the top of the page). If you can't keep the popup window from appearing, you still might be able to use JavaScript to hijack their window. Then you can change the popup's title, size, window contents... here's how.
A popup ad is always opened with JavaScript in the following form: There's probably a lot of other stuff in the popup code, but this is the critical line to watch for, the one that actually defines the popup and makes it appear. The part we're especially concerned with here is the "windowname" section. This tells the browser the name of the window being opened. FWPs are usually dumb and call it something obvious like "adWindow" or "popup". (If they're smart, they have something that's random and changes all the time, like TSw8092358 or something to that effect. If so, you're sh** outta luck.) If you use another line to open another window with the same name, it will actually just load into the existing one, since the window with this name is already there and you can't have two windows with the exact same name. All you have to do then, is use a script like this:
<script language="JavaScript">   
var winname1="adw";   
var winname2="indow";   
var windowname=winname1+winname2;   
arbitrary ="replacement.htm", windowname, 
// arbitrary.close();  //Uncomment this statement to make the popup window go bye-bye :) 
// --> 
Notice the winname1/winname2 part at the beginning, this splits up the windowname so that if the FWP searches for it (looking for scripts like this, most likely) they won't find it. Take whatever name the FWP has for its popup, put the first half of it in for winname1 and the 2nd half for winname2. Also note the 3rd parameter of the, it contains a list of attributes for the popup such as size and scrollability. By changing these you can make the popup any size you want, and other useful things. Remember that as long as your provider has unpreventable popups you have to put the popup replacement page on a different (pop-free) server, otherwise you will get even more popups! A good way to go, if you don't have access to a pop-free account and your ISP doesn't give you webspace, is sign up somewhere that lets you place a banner on your page instead of popups (Virtualave, Fortunecity), put the banner way at the bottom of your replacement page and make the popup window small enough (and non-scrolling) that the banner at the bottom is offscreen and never shows.
Oh, the the possibilities! <sinister laughter> You can make it into an anti-popup protest page, parody ads, a "this provider sucks" window telling everyone how they've violated your beautyful page with popup creative! Some other cool things to do with a repossessed popup window include
Up One Level (Killing Popup Ads)
Home E-mail Copyrights and Disclaimers