summaryrefslogtreecommitdiff
path: root/protocols/MRA/Docs/Mail.ru Agent.files/WindowOpen.js
blob: e5f140e382034705b999dad70603a6ef192894c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// Proxomitron Anti-popup code
//

var PrxLC=new Date(0);
var PrxModAtr=0;
var PrxLd=1;
var PrxInst; if(!PrxInst++) PrxRealOpen=window.open;

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

function PrxWOA(atr){
  var xatr="location=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes";
  if(!PrxModAtr) return(atr);
  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);
}

function PrxRST(){
  if(document.layers){document.captureEvents(Event.MOUSEUP);}
  document.onmouseup=PrxOMUp;
  PrxLd=0;
}

window.open=PrxOpen;
submit=PrxOpen;