forked from genify/nej
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnej_proxy_frame.html
4 lines (4 loc) · 3.14 KB
/
nej_proxy_frame.html
1
2
3
4
<html> <head> <title>NEJ AJAX PROXY</title> <meta charset="utf-8"/>
<script>window.whitelist=[/.*/i];</script>
<script>(function(){var j=[];window.addMsgListener=function(ak){j.push(ak);};var L=function(bn){for(var i=0,l=j.length;i<l;i++)try{j[i].call(null,bn);}catch(e){}};if(! !window.postMessage){window.doPostMessage=function(O,t){t=t||{};O.postMessage(''+t.data,t.origin||'*');};if(! !window.addEventListener){window.addEventListener('message',L,!1);}else{window.attachEvent('onmessage',L);}return;}var G='MSG|',F=[];var bF=(function(){var bs=function(ao){var J={},k=ao.split('|');for(var i=0,l=k.length,R;i<l;i++){R=k[i].split('=');J[decodeURIComponent(R.shift())]=decodeURIComponent(R.join('='));}return J;};return function(){var V=unescape(window.name||'');if(!V||V.indexOf(G)!=0)return;window.name='';V=V.replace(G,'');var t=bs(V),K=(t.origin||'').toLowerCase();if(! !K&&K!='*'&&location.href.toLowerCase().indexOf(K)!=0)return;L({data:t.data,origin:document.referrer});};})();var bU=(function(){var C;var bO=function(bf,T){for(var i=0,l=bf.length;i<l;i++)if(bf[i]==T)return!0;return!1;};return function(){if(!F.length)return;C=[];for(var i=F.length-1,H;i>=0;i--){H=F[i];if(!bO(C,H.w)){C.push(H.w);F.splice(i,1);H.w.name=H.d;}}C=null;};})();window.doPostMessage=(function(){var bh=function(aM){var k=[];for(var x in aM)k.push(encodeURIComponent(x)+'='+encodeURIComponent(aM[x]));return k.join('|');};var aF=function(v){var J={};v=v||{};J.origin=v.origin||'*';J.ref=location.href;J.data=''+v.data;return G+bh(J);};return function(O,t){F.unshift({w:O,d:escape(aF(t))});};})();window.setInterval(bU,100);window.setInterval(bF,50);})();(function(){var ah=function(){var ay=document.referrer||'';if(!ay|| !whitelist.length)return!1;for(var i=0,l=whitelist.length,T;i<l;i++){T=whitelist[i];if(! !T.test&&T.test(ay)||ay==T)return!0;}return!1;};if(!ah())return;var f=function(){};var bA=(function(){var ai=/"/gi,aj=['Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.3.0'];var bj=function(){if(window.XMLHttpRequest)return new XMLHttpRequest();try{for(var i=0,l=aj.length;i<l;i++)return new ActiveXObject(aj[i]);}catch(ex){return null;}};var be=function(t){var v='NEJ-AJAX-DATA:{"key":"'+t.key+'","status":"'+t.status+'","result":"'+encodeURIComponent(t.result)+'"}';if(!window.postMessage)v='"'+v.replace(ai,'\\"')+'"';window.doPostMessage(parent,{data:v});};return function(t){if(!t|| !t.url)return;var h=bj(),G=t.key;var aP,aV=parseInt(t.timeout)||0;if(! !aV){aP=window.setTimeout(function(){h.onreadystatechange=f;h.abort();be({key:G,status: -1});},aV);}h.onreadystatechange=function(){if(h.readyState!=4)return;window.clearTimeout(aP);be({key:G,status:h.status,result:h.responseText||''});};h.open(t.method||'GET',t.url,!0);var bI=t.headers||{};for(var x in bI)h.setRequestHeader(x,bI[x]);h.send(t.data);};})();var aN=(function(){var aX=function(_content){try{return(new Function('return '+_content))();}catch(e){return null;}};return function(_content){if(typeof(_content)!='string')return _content;try{if(! !window.JSON&& ! !JSON.parse)return JSON.parse(_content);}catch(e){return _content;}return aX(_content);};})();window.addMsgListener(function(bn){bA(aN(bn.data));});})(); </script>
</head> <body></body> </html>