Author Topic: New filter for PopUps update 1.Aug.  (Read 758 times)

Admin

  • Forum Admin
  • Administrator
  • Jr. Member
  • *****
  • Posts: 62
    • ICQ Messenger - 1448105
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • Email
New filter for PopUps update 1.Aug.
« on: July 30, 2001, 07:58:18 PM »
Both files: http://arne.jaha.dk/download.php/1,23,13/id12.zip

Hi all,

I've been playing around with yet another variation to Proxomitron's standard
pop-up filters and have come up with a new twist.  This filter captures
onmouseup events and only allows pop-ups that occur within 2 seconds of a mouse
click.  Unlike the normal pop-up filter it seems immune to onload or timer
based pop-ups and only requires one filter to work. It also filters the
attributes the window was opened with and lets you control what features you
want the new window to have (location bar, status bar, etc). The filter has two
parts - the web filter itself, and a JavaScript file it calls. Just place the
JavaScript into a file named "WindowOpen.js" in Proxomitron's html folder (this
needs beta five to work BTW).

The variable "xatr" in the PrxWOA() function controls the settings for each
pop-up window. Only the window size is kept from the original string, but you
could keep other attributes too.

Anyway, it's here for anyone to try out.  Let me know how it works - if it does
a good job it might replace the current filters in newer versions. Also let me
know if you have any questions. If you use it be sure to disable any other
Pop-up filters - you can also try allowing onload events.

-Scott-


[Patterns]

Name = "Smart pop-up windows killer"
Active = TRUE
Limit = 80
Match = "<start>"
Replace = "<!--//-->"
          "<script src="http://Local.ptron/WindowOpen.js">"
          "</script>
"

++++++++++++ WindowOpen.js UPDATED 1 AUGUST +++++++++++++++

PrxRealOpen=window.open;
PrxLC=new Date(0);
function PrxOMUp(){PrxLC=new Date();}
function PrxNW(){return(this.window);}

function PrxOpen(url,nam,atr){
  var cdt=new Date();
  cdt.setTime(cdt.getTime()-PrxLC.getTime());
  if(cdt.getSeconds()<2){
    return(PrxRealOpen(url,nam,PrxWOA(atr)));
  }
  return(new PrxNW());
}

function PrxWOA(atr){
  var
xatr="location=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes";
  if(atr){
    var hm;
    hm=atr.match(/height=[0-9]+/i);
    if(hm) xatr+="," + hm;
    hm=atr.match(/width=[0-9]+/i);
    if(hm) xatr+="," + hm;
  }
  return(xatr);
}

window.open=PrxOpen;
if(document.layers) document.captureEvents(Event.MOUSEUP);
document.onmouseup=PrxOMUp;
++++++++++++++++++++++++++++++++++++++++++++++++

With regards from
Admin
With regards from
Admin