AndrewHaxalot

hackvertor.js

Feb 7th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(){
  2.     var Hackvertor = function() {
  3.         this.historyPos = null;
  4.         this.apps = {};
  5.         this.startTag = '<@';
  6.         this.endTag = '>';
  7.         this.tagNumber = 0;
  8.         this.extendParser = function(parser, appID, code, optParams) {     
  9.                 parser.extendWindow("$clearTagLog$", function() {
  10.                     return document.getElementById('tagLog').value = '';                   
  11.                 });
  12.                 parser.extendWindow("$getTagLog$", function() {
  13.                     return document.getElementById('tagLog').value+'';                 
  14.                 });
  15.                 parser.extendWindow("$tagLog$", function(txt) {
  16.                         if(txt.length > 1000) {
  17.                             txt = 'Maximum 1000 chars allowed in tagLog';
  18.                         }
  19.                         document.getElementById('tagLog').value = ''+txt;
  20.                         document.getElementById('tagLogLayer').style.display='block';
  21.                 });
  22.                 parser.extendWindow("$getJSProps$", function(start, end) {
  23.                     start = parseInt(start);
  24.                     end = parseInt(end);
  25.                     if(start > 0 && end > 0 && start < end && end - start > 1000) {
  26.                         throw new Error("Invalid range selected");
  27.                     }
  28.                     var variables = [];
  29.                     for(var i=start;i<end;i++) {
  30.                         try {
  31.                             eval("01."+String.fromCharCode(i)+"");
  32.                             variables.push(String.fromCharCode(i));
  33.                         } catch(e){}
  34.                     }
  35.                     return variables.join(",");
  36.                 });
  37.                 parser.extendWindow("$getJSVariables$", function(start, end) { 
  38.                    
  39.                     function fixedFromCharCode (codePt) {
  40.                         if (codePt > 0xFFFF) {
  41.                             codePt -= 0x10000;
  42.                             return String.fromCharCode(0xD800 + (codePt >> 10), 0xDC00 +
  43.                     (codePt & 0x3FF));
  44.                         }
  45.                         else {
  46.                             return String.fromCharCode(codePt);
  47.                         }
  48.                     }
  49.                    
  50.                     start = parseInt(start);
  51.                     end = parseInt(end);
  52.                     if(start > 0 && end > 0 && start < end && end - start > 1000) {
  53.                         throw new Error("Invalid range selected");
  54.                     }
  55.                     var validVariables = [];
  56.                         for(i=start;i<end;i++) {
  57.                             var variableTest = fixedFromCharCode(i);       
  58.                             try {
  59.                                 eval(variableTest);
  60.                             } catch(e) {
  61.                                 if((e+'').indexOf('is not defined') != -1) {
  62.                                     validVariables.push(variableTest);
  63.                                 }
  64.                                 if(e.description && e.description.indexOf('is undefined') != -1) {
  65.                                     validVariables.push(variableTest);
  66.                                 }
  67.                                
  68.                             }
  69.                         }
  70.                         return validVariables.join(', ');  
  71.                 });
  72.                 parser.extendWindow("$runCommand$", (function(appID){
  73.                     var HV = window.Hackvertor;
  74.                     return function(command, values) {
  75.                         HV.applicationCommand(appID, command, values);
  76.                     }              
  77.                 })(appID));
  78.                 parser.extendWindow("$sandbox$", function(code){   
  79.                     var js = JSReg.create(), result;
  80.                     js.setDebugObjects({doNotFunctionEval:true,functionCode: function(code) {
  81.                         code = code.replace("J.F();var $arguments$=J.A(arguments);",'');
  82.                         result = code;                     
  83.                     }});
  84.                     try {
  85.                         js.eval(code);
  86.                     } catch(e){
  87.                         return e;
  88.                     }
  89.                     return result;
  90.                 });
  91.                 parser.extendWindow("$crypto$", (function(c){                                                      
  92.                     return {
  93.                         $AES$ : {
  94.                             $encrypt$: function(message, passphrase){                      
  95.                                 return c.AES.encrypt(message, passphrase);
  96.                             },
  97.                             $decrypt$: function(crypted, passphrase){
  98.                                 return c.AES.decrypt(crypted, passphrase);
  99.                             }
  100.                         },
  101.                         $Rabbit$ : {
  102.                             $encrypt$: function(message, passphrase){
  103.                                 return c.Rabbit.encrypt(message, passphrase);
  104.                             },
  105.                             $decrypt$: function(crypted, passphrase){
  106.                                 return c.Rabbit.decrypt(crypted, passphrase);
  107.                             }
  108.                         },
  109.                         $MARC4$ : {
  110.                             $encrypt$: function(message, passphrase){
  111.                                 return c.MARC4.encrypt(message, passphrase);
  112.                             },
  113.                             $decrypt$: function(crypted, passphrase){
  114.                                 return c.MARC4.decrypt(crypted, passphrase);
  115.                             }
  116.                         },
  117.                         $PBKDF2$ : function(passphrase, bits, iterations) {
  118.                             var salt = c.charenc.Binary.bytesToString(Crypto.util.randomBytes(16));
  119.                             return c.PBKDF2(passphrase, salt, bits, { iterations: iterations });
  120.                         },
  121.                         $Base64$ : {
  122.                             $encode$: function(str){
  123.                                 var strBytes = c.charenc.Binary.stringToBytes(str);
  124.                                 return c.util.bytesToBase64(strBytes);
  125.                             },
  126.                             $decode$: function(str){
  127.                                 return String.fromCharCode.apply(null, c.util.base64ToBytes(str));
  128.                             }
  129.                         }
  130.                     };
  131.                 })(window.Crypto));
  132.                 parser.extendWindow("$getUser$", function() {
  133.                         var req = window.Hackvertor.createXHR();
  134.                         if(location.host != 'hackvertor.co.uk') {
  135.                             req.open('GET', '/hackvertor.co.uk/getUser', false);
  136.                         } else {
  137.                             req.open('GET', 'https://hackvertor.co.uk/getUser', false);
  138.                         }
  139.                         req.send(null);
  140.                         if(req.status == 200) {                        
  141.                             return req.responseText;
  142.                         } else {
  143.                             return 'Failed to get user details.';
  144.                         }
  145.                 });            
  146.                 parser.extendWindow("$getUserID$", function(id) {              
  147.                     var req = window.Hackvertor.createXHR();
  148.                     if(location.host != 'hackvertor.co.uk') {
  149.                         req.open('GET', '/hackvertor.co.uk/getUserID?id='+encodeURIComponent(id), false);
  150.                     } else {
  151.                         req.open('GET', 'https://hackvertor.co.uk/getUserID?id='+encodeURIComponent(id), false);
  152.                     }
  153.                     req.send(null);
  154.                     if(req.status == 200) {                        
  155.                         return req.responseText;
  156.                     } else {
  157.                         return 'Failed to get user info.';
  158.                     }
  159.                 });        
  160.                 parser.extendWindow("$loadStorage$", function(appID, id) {             
  161.                     var req = window.Hackvertor.createXHR();
  162.                     if(location.host != 'hackvertor.co.uk') {
  163.                         req.open('GET', '/hackvertor.co.uk/loadStorage?appID='+encodeURIComponent(appID)+'&id='+encodeURIComponent(id), false);
  164.                     } else {
  165.                         req.open('GET', 'https://hackvertor.co.uk/loadStorage?appID='+encodeURIComponent(appID)+'&id='+encodeURIComponent(id), false);
  166.                     }
  167.                     req.send(null);
  168.                     if(req.status == 200) {                        
  169.                         return req.responseText;
  170.                     } else {
  171.                         return 'Failed to get storage.';
  172.                     }
  173.                 });
  174.                 parser.extendWindow("$saveStorage$", function(appID, id, JSON, mode) {             
  175.                     var req = window.Hackvertor.createXHR();
  176.                     if(location.host != 'hackvertor.co.uk') {
  177.                         req.open('GET', '/hackvertor.co.uk/saveStorage?appID='+encodeURIComponent(appID)+'&id='+encodeURIComponent(id)+'&JSON='+encodeURIComponent(JSON)+'&mode='+encodeURIComponent(mode), false);
  178.                     } else {
  179.                         req.open('GET', 'https://hackvertor.co.uk/saveStorage?appID='+encodeURIComponent(appID)+'&id='+encodeURIComponent(id)+'&JSON='+encodeURIComponent(JSON)+'&mode='+encodeURIComponent(mode), false);             
  180.                     }
  181.                     req.send(null);
  182.                     if(req.status == 200) {                        
  183.                         return req.responseText;
  184.                     } else {
  185.                         return 'Failed to get storage.';
  186.                     }
  187.                 });
  188.                 parser.extendWindow("$userConnected$", function(appID) {               
  189.                     var req = window.Hackvertor.createXHR();
  190.                     if(location.host != 'hackvertor.co.uk') {
  191.                         req.open('GET', '/hackvertor.co.uk/userConnected?appID='+encodeURIComponent(appID), false);
  192.                     } else {
  193.                         req.open('GET', 'https://hackvertor.co.uk/userConnected?appID='+encodeURIComponent(appID), false);             
  194.                     }
  195.                     req.send(null);
  196.                     if(req.status == 200) {                        
  197.                         return req.responseText;
  198.                     } else {
  199.                         return 'Failed to connect.';
  200.                     }
  201.                 });
  202.                 parser.extendWindow("$getConnected$", function(appID) {            
  203.                     var req = window.Hackvertor.createXHR();
  204.                     if(location.host != 'hackvertor.co.uk') {
  205.                         req.open('GET', '/hackvertor.co.uk/getConnected?appID='+encodeURIComponent(appID), false);
  206.                     } else {
  207.                         req.open('GET', 'https://hackvertor.co.uk/getConnected?appID='+encodeURIComponent(appID), false);              
  208.                     }
  209.                     req.send(null);
  210.                     if(req.status == 200) {                        
  211.                         return req.responseText;
  212.                     } else {
  213.                         return 'Failed to connect.';
  214.                     }
  215.                 });
  216.                 parser.extendWindow("$getPipe$", function(queryString) {
  217.                     var req = window.Hackvertor.createXHR();
  218.                     req.open('GET', 'https://hackvertor.co.uk/getPipe?queryString='+encodeURIComponent(queryString), false);
  219.                     req.send(null);
  220.                     if(req.status == 200) {                                                                    
  221.                         return decodeURIComponent(req.responseText);
  222.                     } else {
  223.                         return 'Failed to get pipe.';
  224.                     }
  225.                 });
  226.                 parser.extendWindow("$execLanguage$", function(code, input, language) {
  227.                     var req = window.Hackvertor.createXHR();
  228.                     req.open('GET', 'https://hackvertor.co.uk/execLanguage?code='+encodeURIComponent(code)+'&input='+encodeURIComponent(input)+'&language='+encodeURIComponent(language), false);
  229.                     req.send(null);
  230.                     if(req.status == 200) {                                                                    
  231.                         return decodeURIComponent(req.responseText);
  232.                     } else {
  233.                         return 'Failed to get pipe.';
  234.                     }
  235.                 });            
  236.                 if(code !== undefined) {
  237.                     parser.extendWindow('$code$',code);
  238.                     if(optParams) {                
  239.                         parser.extendWindow('$params$',optParams);
  240.                     } else {
  241.                         parser.extendWindow('$params$',window.Hackvertor.params);
  242.                     }              
  243.                 }
  244.                 parser.extendWindow('$outputHTML$',(function(HTMLReg, HV) {
  245.                     var htmlpreview = document.getElementById('htmlpreview');
  246.                     return function(html) {
  247.                             if(htmlpreview.style.display == 'block') {
  248.                                 return 'Already open';
  249.                             }                          
  250.                             html = HTMLReg.parse(html);
  251.                             HV.testHTML(html);
  252.                             return html;
  253.                     }
  254.                 })(window.HTMLReg, window.Hackvertor));
  255.                 parser.extendWindow('$log$',(function(astalanumerator,JSON) {
  256.                     var result = document.getElementById('inspectionResult');
  257.                     return function(obj, compact) {
  258.                             if(result.style.display == 'block') {
  259.                                 return 'Already open';
  260.                             }
  261.                             try {
  262.                                 var json_obj = JSON(obj);
  263.                             } catch(e) {
  264.                                 return "Invalid JSON string.";
  265.                             }                                                                              
  266.                             astalanumerator.init(true);
  267.                             if(compact) {
  268.                                 astalanumerator.compact = true;
  269.                             }
  270.                             astalanumerator.currentObj = json_obj;
  271.                             astalanumerator.inspect(astalanumerator.currentObj, 'astalanumerator.currentObj', result);
  272.                             return '';
  273.                     }
  274.                 })(window.astalanumerator, json_parse));
  275.                 parser.extendObject('$HV$',(function(tags) {
  276.                         return function(tagName, args) {                           
  277.                             if(!tags.hasOwnProperty(tagName)) {
  278.                                 return null;
  279.                             }  
  280.                             if(!args) {
  281.                                 args = [];
  282.                             }                                                      
  283.                             return tags[tagName].execTag(this+'',function(output){ return output; },args, true);                           
  284.                            }
  285.                     })(window.Hackvertor.tags)
  286.                 );                                             
  287.             return parser;
  288.         }
  289.         this.createXHR = function() {
  290.             if (typeof XMLHttpRequest == "undefined") {
  291.               var req = function () {
  292.                 try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }
  293.                   catch (e1) {}
  294.                 try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); }
  295.                   catch (e2) {}
  296.                 try { return new ActiveXObject("Msxml2.XMLHTTP"); }
  297.                   catch (e3) {}                      
  298.                 throw new Error("This browser does not support XMLHttpRequest.");
  299.               };
  300.             } else {
  301.                 var req = new XMLHttpRequest();
  302.             }
  303.           return req;  
  304.         }
  305.         this.checkBase64 = function() {
  306.             if(document.getElementById('nosave').checked) {
  307.                 str = window.Hackvertor.settings.input.value+'';               
  308.                 var strBytes = Crypto.charenc.Binary.stringToBytes(str);               
  309.                 location.hash = Crypto.util.bytesToBase64(strBytes);
  310.                 this.hideHvurl();
  311.                 return false;
  312.             } else {
  313.                 return true;
  314.             }
  315.         }
  316.         this.hvurl = function() {
  317.             if(!window.Hackvertor.settings.input||window.Hackvertor.settings.input.value == '') {
  318.                 alert('You need to enter something into Hackvertor first.');
  319.                 return false;
  320.             }
  321.             window.Hackvertor.settings.hvurlWindow.style.display = 'block';
  322.             window.Hackvertor.settings.hvurlData.value = window.Hackvertor.settings.input.value;
  323.         }
  324.         this.hideHvurl = function() {
  325.             window.Hackvertor.settings.hvurlWindow.style.display = 'none';
  326.         }      
  327.         this.applicationCommand = function(appID, command, values) {                                   
  328.             if(typeof values != 'object') {
  329.                 values = [];
  330.             }
  331.             var obj = this.apps['$'+appID+'$'];
  332.             obj['$'+command+'$'].apply(null, values);                                  
  333.         }
  334.         this.loadApplication = function(code, appID) {             
  335.             DomAPI.setAppID(appID);
  336.             CSSReg.setAppID(appID);
  337.             HTMLReg.setAppID(appID);   
  338.             var parser = DomAPI.createParser();
  339.             parser = window.Hackvertor.extendParser(parser, appID);
  340.             parser.extendWindow('$'+appID+'$', (function(appID){
  341.                 var HV = window.Hackvertor;
  342.                 return function(command, values) {
  343.                     HV.applicationCommand(appID, command, values);
  344.                 }              
  345.             })(appID));
  346.             var site = parser.eval(code);          
  347.             var appHTML = '<html>';
  348.             appHTML += '<head>';
  349.             appHTML += '<base target="_top" />';
  350.             appHTML += '<title>'+appID+'</title>';                     
  351.             appHTML += '<style type="text/css">' + CSSReg.parse(site.$styles$()) + '</style>';             
  352.             appHTML += '</head>';
  353.             appHTML += '<body id="'+appID+'">';                                                    
  354.             appHTML += HTMLReg.parse(site.$html$());       
  355.             appHTML += '</body>';
  356.             appHTML += '</html>';          
  357.             var doc = document.getElementById('application').contentWindow.document;           
  358.             doc.open();        
  359.             doc.write(appHTML);
  360.             doc.close();
  361.             document.getElementById('application').contentWindow.site = site;
  362.             DomAPI.setDocument(doc);
  363.             this.apps['$'+appID+'$'] = site;
  364.             this.applicationCommand(appID, 'home', []);
  365.         }
  366.         this.naturalLanguage = function() {
  367.             var text = document.getElementById('naturalLanguage').value,
  368.                 commands = nlsm.parse(text),
  369.                 tags = [];
  370.            
  371.             if(!this.getSelectedText()) {
  372.                 this.selectInput();
  373.             }
  374.            
  375.             for(var i=0;i<commands.length;i+=2) {
  376.                 var command = commands[i+1];
  377.                 if(commands[i] == 'encode') {
  378.                     for(var id in this.tagIDS) {
  379.                         if(this.tagIDS.hasOwnProperty(id)) {
  380.                             if(this.tagIDS[id] == command) {
  381.                                 tags.push(id);
  382.                                 break;
  383.                             }
  384.                         }
  385.                     }
  386.                 } else {
  387.                     var foundDecode = 0;
  388.                     for(var id in this.tagIDS) {
  389.                         if(this.tagIDS.hasOwnProperty(id)) {
  390.                             if(this.tagIDS[id] == 'd_'+command) {                          
  391.                                 tags.push(id);
  392.                                 foundDecode = 1;
  393.                                 break;
  394.                             }
  395.                         }
  396.                     }
  397.                     if(!foundDecode) {
  398.                         tags.push(71);
  399.                     }
  400.                 }                              
  401.                
  402.             }
  403.             this.selectTag(tags);          
  404.         }
  405.         this.clear = function() {
  406.                 this.settings.input.value='';
  407.                 this.settings.output.value='';
  408.                 this.settings.input.focus();
  409.                 this.showLengths();
  410.         }
  411.         this.clearTags = function() {
  412.             var hv = window.Hackvertor;
  413.             var input = hv.settings.input.value;
  414.             var regexpString = hv.startTag+'([_0-9a-zA-Z]+)(\\(.*\\))?'+hv.endTag;
  415.             input = input.replace(new RegExp(regexpString,'g'),'');
  416.             var regexpString = hv.startTag+'\/([_0-9a-zA-Z]+)'+hv.endTag;
  417.             input = input.replace(new RegExp(regexpString,'g'),'');
  418.             hv.settings.input.value = input;
  419.             hv.settings.input.focus();
  420.             hv.showLengths();
  421.         }
  422.         this.swapInput = function() {
  423.             this.settings.input.value=this.settings.output.value;
  424.             this.settings.output.value=''
  425.             this.settings.input.focus();
  426.             this.showLengths();        
  427.         }
  428.         this.selectInput = function() {    
  429.             this.settings.input.focus();
  430.             this.settings.input.select();          
  431.         }
  432.         this.selectOutput = function() {
  433.             this.settings.output.focus();
  434.             this.settings.output.select();         
  435.         }
  436.         this.convert = function() {        
  437.             this.execute();            
  438.             this.showLengths();
  439.             this.selectOutput();
  440.         }
  441.         this.resetParams = function() {
  442.             this.params = [];
  443.         }
  444.         this.formatParam = function(param) {
  445.             if(!/[^\d.]/.test(param) && /[.]/.test(param) && /[\d]/.test(param)) {
  446.                 return parseFloat(param);
  447.             } else if(!/[^\d]/.test(param) && /[\d]/.test(param)) {
  448.                 return parseInt(param);
  449.             } else {
  450.                 return ''+param;
  451.             }
  452.         }
  453.         this.setParams = function(params) {
  454.             params = params.replace(/^\(|\)$/g,'');
  455.             params = params.replace(/((['])([^']*|\\['])(['])|(["])([^"]*|\\["])(["]))/g, function($0, $1, $2, $3, $4, $5, $6) {                           
  456.                 return $5 == '"' ? escape($6) : escape($3);
  457.             });
  458.             this.params = params.split(',');
  459.             for(var i in this.params) {
  460.                 this.params[i] = this.formatParam(unescape(this.params[i]));
  461.             }
  462.         }
  463.         this.addTag = function(obj) {                  
  464.             this.tagIDS[obj.id] = obj.name;
  465.             if(typeof this.categories[obj.categoryID] == 'undefined') {
  466.                 this.categories[obj.categoryID] = [obj.id];
  467.             } else {
  468.                 this.categories[obj.categoryID].push(obj.id);
  469.             }
  470.             this.tags[obj.name] = {code:obj.code, param1:obj.param1, param2:obj.param2, param3:obj.param3, userID: obj.userID, help:obj.help,                      
  471.             execTag:function(code, callback, optParams, createNew) {                   
  472.                 if(createNew) {
  473.                     if(!window.APIParser) {
  474.                         window.APIParser = JSReg.create();
  475.                     }
  476.                     var parser = window.APIParser;
  477.                     parser.init();
  478.                 } else {                               
  479.                     var parser = window.parser;                
  480.                 }
  481.                 parser.setDebugObjects({
  482.                     errorLog:function(msg) {
  483.                     callback(msg);
  484.                 },
  485.                 errorHandler:function(e) {
  486.                     if (e.description) {
  487.                             var msg = '';
  488.                             if (e.description) {
  489.                                 msg += 'Description:' + e.description + '\n';
  490.                             }
  491.                             if(e.msg) {
  492.                                 msg += 'Msg:'+e.msg+'\n';
  493.                             }
  494.                             if (e.line) {
  495.                                 msg += 'Line:' + e.line+'\n';
  496.                             }                  
  497.                                                
  498.                             if (parser.debugObjects.parseTree) {
  499.                                 parser.debugObjects.parseTree(e.parseTree);
  500.                             }                  
  501.                             if (parser.debugObjects.errorLog) {
  502.                                 parser.debugObjects.errorLog(msg);
  503.                             } else {
  504.                                 alert(msg);
  505.                             }
  506.                         } else {
  507.                             if (parser.debugObjects.errorLog) {
  508.                                 parser.debugObjects.errorLog(e);
  509.                             } else {
  510.                                 alert(e);
  511.                             }
  512.                         }          
  513.                 },
  514.                 result:function(code){                 
  515.                     callback(code);
  516.                 },
  517.                 onComplete:(function(parser){ return function(result) {            
  518.                     parser.init();                                     
  519.                 }
  520.                 })(parser)                                             
  521.                 });            
  522.                 parser = window.Hackvertor.extendParser(parser, obj.name, code, optParams);
  523.                 return parser.eval(obj.code);              
  524.             }};
  525.         };
  526.         this.addAPIFunction = function(code) {
  527.             codeEditor.replaceSelection(code);
  528.         };
  529.         this.addAPICall = function(tagID) {        
  530.             var hv = window.Hackvertor;
  531.             var tag = hv.tags[hv.tagIDS[tagID]];
  532.             var name = hv.tagIDS[tagID];
  533.             var txt = hv.getSelectedText();
  534.             var data;
  535.             var input = hv.settings.input;         
  536.             var tagName = ".HV('" + name + "'";        
  537.             if(tag.param1 != '') {
  538.                 tagName += ',[';
  539.                 tagName += formatVar(tag.param1);
  540.                 if(tag.param2 != '') {
  541.                     tagName += ','+formatVar(tag.param2);  
  542.                 }
  543.                 if (tag.param3 != '') {
  544.                     tagName += ','+formatVar(tag.param3);
  545.                 }  
  546.                 tagName += ']';
  547.             }  
  548.             tagName += ')';
  549.             function formatVar(str) {
  550.                 if(/[^\d]/.test(str)) {
  551.                     return "'" + str.replace(/'/g,'\\\'') + "'";
  552.                 } else {
  553.                     return str;
  554.                 }
  555.             }
  556.            
  557.             codeEditor.replaceSelection(tagName);
  558.         };
  559.         this.selectTag = function(tagID) {
  560.             var hv = window.Hackvertor,
  561.                 input = hv.settings.input;
  562.             if(typeof tagID != 'object') {
  563.                 tagList = [tagID];
  564.             } else {
  565.                 tagList = tagID;
  566.             }
  567.             var data = input.value,
  568.                 txt = hv.getSelectedText(),            
  569.                 start = '',
  570.                 end = '',
  571.                 startTag = [],
  572.                 endTag = [];               
  573.             if(!document.selection || navigator.userAgent.indexOf("Opera") > -1) {
  574.                 start = data.substr(0, input.selectionStart);
  575.                 end = data.substr(input.selectionEnd, data.length);
  576.             } else {
  577.                 if(document.selection) {                               
  578.                     var range = document.selection.createRange();
  579.                     var stored_range = range.duplicate();
  580.                     stored_range.moveToElementText(input);
  581.                     stored_range.setEndPoint( 'EndToEnd', range );
  582.                     input.selectionStart = stored_range.text.length - range.text.length;
  583.                     input.selectionEnd = input.selectionStart + range.text.length;                 
  584.                     start = '' + data.substr(0, input.selectionStart);
  585.                     end = data.substr(input.selectionEnd, data.length);                                                        
  586.                 }
  587.             }          
  588.             for(var i=0;i<tagList.length;i++) {
  589.                 tagID = tagList[i];                                                                
  590.                 var tag = hv.tags[hv.tagIDS[tagID]];
  591.                 var name = hv.tagIDS[tagID];               
  592.                 var tagName = name + '_' + hv.tagNumber + '';
  593.                 var firstTagName = tagName;
  594.                 if(tag.param1 != '') {
  595.                     firstTagName += '(';
  596.                     firstTagName += tag.param1;
  597.                     if(tag.param2 != '') {
  598.                         firstTagName += ','+tag.param2;
  599.                     }
  600.                     if (tag.param3 != '') {
  601.                         firstTagName += ','+tag.param3;
  602.                     }          
  603.                     firstTagName += ')';
  604.                 }      
  605.                 hv.tagNumber++;                    
  606.                 if(!document.selection || navigator.userAgent.indexOf("Opera") > -1) {                                             
  607.                     startTag.push(hv.startTag + firstTagName + hv.endTag);
  608.                     endTag.push(''+ hv.startTag + '/' + tagName + hv.endTag);                                                                                                      
  609.                 } else {                   
  610.                     if(document.selection) {           
  611.                         var range = document.selection.createRange();
  612.                         var stored_range = range.duplicate();
  613.                         stored_range.moveToElementText(input);
  614.                         stored_range.setEndPoint( 'EndToEnd', range );
  615.                         input.selectionStart = stored_range.text.length - range.text.length;
  616.                         input.selectionEnd = input.selectionStart + range.text.length;                 
  617.                         startTag.push(hv.startTag + firstTagName + hv.endTag);
  618.                         endTag.push('' + hv.startTag + '/' + tagName + hv.endTag);                                                                                                     
  619.                     } else {                   
  620.                         startTag.push(hv.startTag + firstTagName + hv.endTag);
  621.                         endTag.push('' + hv.startTag + '/' + tagName + hv.endTag);                 
  622.                     }                                                          
  623.                 }              
  624.             }          
  625.             input.value=start+startTag.reverse().join('')+txt+endTag.join('')+end;
  626.             hv.showLengths();              
  627.             input.focus();
  628.             this.convert();
  629.         };
  630.         this.getSelectedText = function() {    
  631.             var txt = '';    
  632.             if(window.getSelection) {
  633.                txt = window.getSelection();
  634.             } else if (document.getSelection) {
  635.                 txt = document.getSelection();
  636.             } else if (document.selection) {
  637.                 txt = document.selection.createRange().text;
  638.             } else {
  639.                 return;      
  640.             }
  641.            
  642.             var input = window.Hackvertor.settings.input;
  643.             if(txt == '') {
  644.               txt = (input.value).substring(input.selectionStart,input.selectionEnd);      
  645.               return txt;
  646.             } else {
  647.               return txt;
  648.             }
  649.         }      
  650.         this.escape = function(str) {
  651.             str = str +'';
  652.             str = str.replace(/./g,function(c){
  653.                 return '&#' + c.charCodeAt(0) + ';';
  654.             });
  655.             return str;
  656.         };
  657.         this.tagHTML = '';
  658.         this.clearTagHTML = function() {
  659.             window.Hackvertor.tagHTML = '';
  660.         };
  661.         this.showTag = function(tagID) {
  662.             var tag = window.Hackvertor.tags[window.Hackvertor.tagIDS[tagID]];
  663.             var name = window.Hackvertor.tagIDS[tagID];
  664.             window.Hackvertor.tagHTML += '<span title="'+window.Hackvertor.escape(tag.help)+'" class="highlight" onmousedown="Hackvertor.selectTag('+tagID+')">'+window.Hackvertor.escape(name)+'</span>';
  665.         };
  666.        
  667.         this.checkID = function(id, userID) {          
  668.             if(typeof window.Hackvertor.categories[id] != 'undefined') {
  669.                 var tagList = window.Hackvertor.categories[id];
  670.                 for(var i = 0;i<tagList.length;i++) {
  671.                     var tagID = tagList[i];                
  672.                     if(window.Hackvertor.tags[window.Hackvertor.tagIDS[tagID]].userID != userID && userID != '') {
  673.                         continue;
  674.                     }
  675.                     window.Hackvertor.showTag(tagID);
  676.                 }
  677.             }
  678.         }
  679.         this.hexView = function(text) {
  680.             text = text+'';
  681.             text = text.replace(/./mg, function(c) {
  682.                 return ' ' + '0x' + /..$/.exec('00'+ c.charCodeAt(0).toString(16));
  683.             });
  684.             window.Hackvertor.testHTML(text);
  685.         }
  686.         this.changeCategory = function(id) {
  687.             if(!document.getElementById('usersTags')) {
  688.                 return false;
  689.             }
  690.             var userID = document.getElementById('usersTags').options[document.getElementById('usersTags').selectedIndex].value;
  691.             window.Hackvertor.clearTagHTML();          
  692.             window.Hackvertor.checkID(id, userID);         
  693.             window.Hackvertor.settings['tagContainer'].innerHTML = window.Hackvertor.tagHTML;                      
  694.         };
  695.         this.appendSelect = function(select, value, content) {
  696.             var opt;
  697.             opt = document.createElement("option");
  698.             opt.value = value;
  699.             opt.appendChild(document.createTextNode(content));
  700.             select.appendChild(opt);
  701.         }
  702.         this.clearSelect = function(select) {          
  703.                 while (select.length > 1) {
  704.                     select.remove(select.length-1);
  705.                 }          
  706.         }
  707.         this.categories = {};              
  708.         this.tags = {          
  709.         };
  710.         this.tagIDS = {};
  711.         this.hvurls = [];
  712.         this.run = function(code, type, callback) {                    
  713.             this.tags[type].execTag(code, callback);
  714.         }
  715.         this.execute = function() {
  716.             var input = this.settings.input.value;     
  717.             this.output = input;
  718.             var regexpString;
  719.             var tagOrder = [];
  720.             var re = new RegExp(this.startTag+'[\\w\\d]+(\\([^)]*\\))?\\s\/'+this.endTag + '|' + this.startTag+'\/[\\w\\d]+'+'\\'+this.endTag,'g');
  721.             var matchedTags = this.output.match(re);
  722.             if(matchedTags != null) {
  723.                 for(var i=0;i<matchedTags.length;i++) {            
  724.                     matchedTags[i] = matchedTags[i].replace(/\(.+\)\s*/,'');
  725.                     tagOrder.push(matchedTags[i].replace(new RegExp('['+this.startTag+this.endTag+'\/]','g'), ''));
  726.                 }
  727.                 var tagPos = 0;                
  728.                 this.execTagOrder(0, tagOrder);
  729.             }                                          
  730.         }
  731.         this.regexpTags = function() {
  732.             var hv = window.Hackvertor;
  733.             var input = hv.settings.input.value;
  734.             if(input == '') {
  735.                 alert('Enter some text and tags');
  736.                 return false;
  737.             }
  738.             var converted = '';
  739.             var regexpString = hv.startTag+'([_0-9a-zA-Z]+)(\\(.*?\\))?'+hv.endTag;
  740.             var tags = [];
  741.             input = input.replace(new RegExp(regexpString,'g'),function($0, name, params) {        
  742.                 tags.push({name:name.replace(/_\d+$/,''), params: params});                        
  743.                 return '';
  744.             });
  745.             var regexpString = hv.startTag+'\/([_0-9a-zA-Z]+)'+hv.endTag;
  746.             input = input.replace(new RegExp(regexpString,'g'),'');
  747.             var regexp = prompt('Enter your regexp to split the input and apply the tags to');
  748.             regexp = new RegExp(regexp+'','g');
  749.             var counter = 0;
  750.             input.replace(regexp, function(txt) {
  751.                 var out = [];
  752.                 var out2 = [];
  753.                 for(var i=0;i<tags.length;i++) {
  754.                     var tag = tags[i];
  755.                     out.push(hv.startTag+tag.name+'_'+counter+tag.params+hv.endTag);
  756.                     out2.push(hv.startTag+'/'+tag.name+'_'+counter+hv.endTag);
  757.                     counter++;
  758.                 }
  759.                 converted += out.join("")+txt+out2.reverse().join("");
  760.             });
  761.             hv.settings.input.value = converted;
  762.         }
  763.         this.execTagOrder = function(tagPos, tagOrder){        
  764.             var that = this;
  765.             regexpString = this.startTag + '(' + tagOrder[tagPos] + ')(\\(.*\\))?' + this.endTag + '(([\\S\\s])*?)' + this.startTag + '\/(' + tagOrder[tagPos] + ')' + this.endTag + '|' + this.startTag + '(' + tagOrder[tagPos] + ')(\\(.*\\))?' + '\\s*\\/' + this.endTag;
  766.             var re = new RegExp(regexpString);
  767.             var matches = '';
  768.             var r = re.exec(this.output);
  769.             if (r != null) {
  770.                 this.resetParams();
  771.                 r[1] = !r[1] ? r[6] : r[1];
  772.                 var type = r[1].replace(/_[\s\d]+$/, '');
  773.                 var actualTagName = r[1];
  774.                 var params = !r[2] ? r[7] : r[2];
  775.                 if (params != null) {
  776.                     this.setParams(params);
  777.                 }
  778.                 var code = r[3];
  779.                 try {
  780.                     if (code === undefined) {
  781.                         code = '';
  782.                     }                  
  783.                     this.run(code, type, function(result) {                        
  784.                         result = result + '';                      
  785.                         result = result.replace(/\$/g, '$$$$');                    
  786.                         regexpString = that.startTag + '(' + actualTagName + ')(\\(.*\\))?' + that.endTag + '(([\\S\\s]*))' + that.startTag + '\/(' + actualTagName + ')' + that.endTag + '|' + that.startTag + '(' + actualTagName + ')(\\(.*\\))?\\s*\/' + that.endTag;
  787.                         that.output = that.output.replace(new RegExp(regexpString), result);                       
  788.                         if(++tagPos < tagOrder.length) {                           
  789.                             that.execTagOrder(tagPos, tagOrder);                           
  790.                         } else {                           
  791.                             that.settings.output.value = that.output;
  792.                             if(that.settings.outputCallback) {
  793.                                 that.settings.outputCallback(that.output);
  794.                             }
  795.                         }                      
  796.                     });                                    
  797.                 }
  798.                 catch (e) {
  799.                     alert('--Error Performing conversion--\n' + e);
  800.                     return 'Please check syntax.';
  801.                 }
  802.             }
  803.         }
  804.         this.realLength = function(str) {
  805.             var len = 0;           
  806.             str.replace(/(?:[\f\n\u000b\u2028\u2029]|.)/gi,function(c) {                                               
  807.                 if(c.charCodeAt() <= 0x007F) {
  808.                     len++;
  809.                 } else if(c.charCodeAt() <= 0x07FF) {
  810.                     len+=2;
  811.                 } else if(c.charCodeAt() <= 0xFFFF) {
  812.                     len+=3;
  813.                 } else if(c.charCodeAt() <= 0x10FFFF) {
  814.                     len+=4;
  815.                 }                                              
  816.             });        
  817.             return len;
  818.         }
  819.         this.showLengths = function() {
  820.             this.settings.inputCharLen.innerHTML=+this.settings.input.value.length;
  821.             this.settings.outputCharLen.innerHTML=+this.settings.output.value.length;
  822.             this.settings.inputUnicodeCharLen.innerHTML=+this.realLength(this.settings.input.value);
  823.             this.settings.outputUnicodeCharLen.innerHTML=+this.realLength(this.settings.output.value);
  824.         }      
  825.         this.settings = function(settings) {
  826.             this.settings = settings;
  827.         }
  828.         this.addSetting = function(name, value) {
  829.             this.settings[name] = value;
  830.         }
  831.         this.encodeForPreview = function(str) {
  832.             str = str.replace(/[^\w\n\r ]/gi,function(c) {
  833.                 return '&#' + c.charCodeAt() + ';';
  834.             });
  835.             str = str.replace(/[ ]/gi,'&nbsp;').replace(/[\t]/gi,'&nbsp;&nbsp;&nbsp;').replace(/[\r\n]/gi,'<br>');         
  836.             return str;
  837.         }
  838.         this.funcInspect = function() {
  839.             var obj = eval(this.settings.output.value);
  840.             var jsBuiltInProps = ['enumerable','configurable','set','get','writable','$','$&','$\'','$*','$+','$1','$2','$3','$4','$5','$6','$7','$8','$9','$`','APPLICATION','ATOMICSELECTION','AddChannel','AddDesktopComponent','AddFavorite','Anchor','Applet','Area','Array','Attr','AutoCompleteSaveForm','AutoScan','BGCOLOR','BaseHref','BehaviorUrnsCollection','BookmarkCollection','Boolean','Button','CSSCurrentStyleDeclaration','CSSRuleList','CSSRuleStyleDeclaration','CSSStyleDeclaration','CSSStyleRule','CSSStyleSheet','Checkbox','ChooseColorDlg','CompatibleInfo','CompatibleInfoCollection','ControlRangeCollection','Count','DOMImplementation','DataTransfer','Date','Dialog','E','Element','Event','FieldDelim','FileUpload','Form','Frame','Function','GetObject','HTCElementBehaviorDefaults','HTMLAnchorElement','HTMLAreaElement','HTMLAreasCollection','HTMLBGSoundElement','HTMLBRElement','HTMLBaseElement','HTMLBaseFontElement','HTMLBlockElement','HTMLBodyElement','HTMLButtonElement','HTMLCollection','HTMLCommentElement','HTMLDDElement','HTMLDListElement','HTMLDTElement','HTMLDivElement','HTMLDocument','HTMLEmbedElement','HTMLFieldSetElement','HTMLFontElement','HTMLFormElement','HTMLFrameElement','HTMLFrameSetElement','HTMLGenericElement','HTMLHRElement','HTMLHeadElement','HTMLHeadingElement',1,'HTMLHtmlElement','HTMLIFrameElement','HTMLImageElement','HTMLInputElement','HTMLIsIndexElement','HTMLLIElement','HTMLLabelElement','HTMLLegendElement','HTMLLinkElement','HTMLMapElement','HTMLMarqueeElement','HTMLMetaElement','HTMLModelessDialog','HTMLNamespaceInfo','HTMLNamespaceInfoCollection','HTMLNextIdElement','HTMLNoShowElement','HTMLOListElement','HTMLObjectElement','HTMLOptionElement','HTMLParagraphElement','HTMLParamElement','HTMLPhraseElement','HTMLPluginsCollection','HTMLPopup','HTMLScriptElement','HTMLSelectElement','HTMLSpanElement','HTMLStyleElement','HTMLTableCaptionElement','HTMLTableCellElement','HTMLTableColElement','HTMLTableElement','HTMLTableRowElement','HTMLTableSectionElement','HTMLTextAreaElement','HTMLTextElement','HTMLTitleElement','HTMLUListElement','HTMLUnknownElement','Helper','Hidden','History','Image','ImportExportFavorites','Infinity','isArray','IsSubscribed','JSON','JavaArray','JavaClass','JavaObject','JavaPackage','LN10','LN2','LOG10E','LOG2E','Layer','Link','Location','MAX_VALUE','MIN_VALUE','Math','Methods','MimeType','NEGATIVE_INFINITY','NaN','NamedNodeMap','NavigateAndFind','Navigator','NodeList','Number','Object','Option','PI','POSITIVE_INFINITY','Packages','Password','Plugin','Radio','RegExp','Reset','SECURITY','SQRT1_2','SQRT2','STYLE','Screen','ScriptEngine','ScriptEngineBuildVersion','ScriptEngineMajorVersion','ScriptEngineMinorVersion','Select','Selection','ShowBrowserUI','StaticNodeList','Storage','String','Style','StyleSheetList','StyleSheetPage','StyleSheetPageList','Submit','Text','TextNode','TextRange','TextRangeCollection','TextRectangle','TextRectangleList','Textarea','UNSELECTABLE','URL','URLUnencoded','UTC','Window','XDomainRequest','XMLDocument','XMLHttpRequest','XMLNS','XSLDocument','__caller__','__count__','__defineGetter__','__defineSetter__','__iterator__','__lookupGetter__','__lookupSetter__','__noSuchMethod__','__parent__','__proto__','_content','aLink','aLinkcolor','abbr','abort','above','abs','accelerator','accept','acceptCharset','accessKey','acos','action','activeElement','add','addBehavior','addElement','addImport','addListener','addPageRule','addProperty','addReadRequest','addRule','addheader','additive','alert','align','alinkColor','all','allowDomain','allowTransparency','alt','altHTML','altKey','altLeft','anchor','anchors','and','appCodeName','appCore','appMinorVersion','appName','appVersion','appendChild','appendData','applets','applicationName','apply','applyElement','archive','areas','arguments','arguments.callee','arguments.caller','arguments.length','aria-activedescendant','aria-busy','aria-checked','aria-controls','aria-describedby','aria-disabled','aria-expanded','aria-flowto','aria-haspopup','aria-hidden','aria-invalid','aria-labelledby','aria-level','aria-live','aria-multiselectable','aria-owns','aria-posinset','aria-pressed','aria-readonly','aria-relevant','aria-required','aria-secret','aria-selected','aria-setsize','aria-valuemax','aria-valuemin','aria-valuenow','arity','asin','assign','atEnd','atan','atan2','atob','attachAudio','attachEvent','attachMovie','attachSound','attachVideo','attribute','attributes','autoSize','autocomplete','availHeight','availLeft','availTop','availWidth','axis','back','background','backgroundAttachment','backgroundColor','backgroundImage','backgroundPosition','backgroundPositionX','backgroundPositionY','backgroundRepeat','balance','banner','bannerAbstract','beginFill','beginGradientFill','behavior','behaviorUrns','below','bgColor','bgProperties','bind','big','blink','blockDirection','blockFormats','blockIndent','blur','body','bold','boolean','border','borderBottom','borderBottomColor','borderBottomStyle','borderBottomWidth','borderCollapse','borderColor','borderColorDark','borderColorLight','borderLeft','borderLeftColor','borderLeftStyle','borderLeftWidth','borderRight','borderRightColor','borderRightStyle','borderRightWidth','borderSpacing','borderStyle','borderTop','borderTopColor','borderTopStyle','borderTopWidth','borderWidth','borderWidths','bottom','bottomMargin','bottomScroll','boundElements','boundingHeight','boundingLeft','boundingTop','boundingWidth','boxSizing','break','broadcastMessage','browserLanguage','btoa','bufferDepth','bullet','button','byte','call','callee','caller','canHaveChildren','canHaveHTML','cancelBubble','capabilities','caption','captionSide','captureEvents','case','catch','ceil','cellIndex','cellPadding','cellSpacing','cells','ch','chOff','char','charAt','charCodeAt','characterSet','charset','checked','childNodes','children','chr','cite','class','className','classes','classid','clear','clearAttributes','clearData','clearInterval','clearRequest','clearTimeout','click','clientHeight','clientInformation','clientLeft','clientTop','clientWidth','clientX','clientY','clip','clipBottom','clipLeft','clipRight','clipTop','clipboardData','cloneNode','close','closed','code','codeBase','codeType','colSpan','collapse','color','colorDepth','cols','compact','compareEndPoints','compatMode','compatible','compile','complete','componentFromPoint','components','concat','condenseWhite','confirm','connect','const','constructor','contains','content','contentDocument','contentEditable','contentOverflow','contentType','contentWindow','contextual','continue','control','controlRange','controllers','cookie','cookieEnabled','coords','cos','counterIncrement','counterReset','cpuClass','create','createAttribute','createCaption','createComment','createControlRange','createDocumentFragment','createElement','createEmptyMovieClip','createEventObject','createPopup','createRange','createStyleSheet','createTFoot','createTHead','createTextField','createTextNode','createTextRange','crypto','cssText','ctrlKey','ctrlLeft','current','currentStyle','cursor','curveTo','data','dataFld','dataFormatAs','dataPageSize','dataSrc','dataTransfer','dateTime','debugger','declare','decode','decodeURI','decodeURIComponent','default','defaultCharset','defaultChecked','defaultSelected','defaultStatus','defaultValue','defaultView','defaults','defer','defineProperty','defineProperties','delete','deleteCaption','deleteCell','deleteData','deleteRow','deleteTFoot','deleteTHead','description','designMode','detachEvent','deviceXDPI','deviceYDPI','dialogArguments','dialogHeight','dialogLeft','dialogTop','dialogWidth','dimensions','dir','direction','directories','disableExternalCapture','disabled','display','do','doImport','doReadRequest','doScroll','docTypeDecl','doctype','document','documentElement','documentMode','domain','double','dragDrop','dragOut','dragOver','dropEffect','dump','duplicate','duplicateMovieClip','duration','dynsrc','effectAllowed','elementFromPoint','elements','else','embedFonts','embeds','empty','emptyCells','enableExternalCapture','enabled','enabledPlugin','encodeURI','encodeURIComponent','encoding','enctype','endFill','enterFrame','enum','eq','escape','eval','evaluate','event','every','exec','execCommand','execScript','exp','expando','export','extends','external','face','fgColor','fileCreatedDate','fileModifiedDate','fileName','fileSize','fileUpdatedDate','filename','filter','filters','final','finally','find','findText','fireEvent','firstChild','firstPage','fixed','float','floor','flush','focus','focusEnabled','font','fontColor','fontFamily','fontSize','fontSmoothingEnabled','fontStyle','fontVariant','fontWeight','fontcolor','fonts','fontsize','for','forEach','form','formName','forms','forward','frame','frameBorder','frameElement','frameSpacing','frames','fromCharCode','fromElement','freeze','frozen','fscommand','function','galleryImg','ge','get','getAdjacentText','getAllResponseHeaders','getAscii','getAttention','getAttribute','getAttributeNode','getBeginIndex','getBookmark','getBounds','getBytesLoaded','getBytesTotal','getCaretIndex','getCharset','getClientRects','getCode','getCookie','getData','getDate','getDay','getDepth','getDuration','getElementById','getElementsByName','getElementsByTagName','getEndIndex','getExpression','getFocus','getFontList','getFullYear','getHours','getItem','getMilliseconds','getMinutes','getMonth','getNamedItem','getNewTextFormat','getOwnPropertyDescriptor','getOwnPropertyNames','getPan','getPosition','getProperty','getPrototypeOf','getRGB','getResponseHeader','getSeconds','getSelection','getSize','getTextExtent','getTextFormat','getTime','getTimer','getTimezoneOffset','getTransform','getURL','getUTCDate','getUTCDay','getUTCFullYear','getUTCHours','getUTCMilliseconds','getUTCMinutes','getUTCMonth','getUTCSeconds','getUTCYear','getVarDate','getVersion','getVolume','getYear','global','globalToLocal','go','goto','gotoAndPlay','gotoAndStop','gt','handleEvent','hasAccessibility','hasAudio','hasAudioEncoder','hasChildNodes','hasFeature','hasFocus','hasLayout','hasMP3','hasOwnProperty','hasVideoEncoder','hash','headers','height','hidden','hide','hideFocus','history','hitArea','hitTest','home','host','hostname','href','hreflang','hscroll','hspace','html','htmlFor','htmlText','httpEquiv','id','ids','if','ifFrameLoaded','ignoreCase','ignoreWhite','images','imeMode','implementation','implements','import','imports','in','inRange','include','indent','indeterminate','index','indexOf','innerHTML','innerHeight','innerText','innerWidth','input','insertAdjacentElement','insertAdjacentText','insertBefore','insertCell','insertData','insertRow','install','instanceof','int','interface','isActive','isAlternate','isContentEditable','isDebugger','isDisabled','isDown','isEqual','isFinite','isMap','isMultiLine','isNaN','isOpen','isPrefAlternate','isPropertyEnumerable','isPrototypeOf','isTextEdit','isToggled','italic','italics','item','java','javaEnabled','join','keys','keyCode','keyDown','keyPress','keyUp','label','lang','language','lastChild','lastIndex','lastIndexOf','lastMatch','lastModified','lastPage','lastParen','layerX','layers','layoutFlow','layoutGrid','layoutGridChar','layoutGridLine','layoutGridMode','layoutGridType','lbound','le','leading','left','leftContext','leftMargin','length','letterSpacing','lineBreak','lineHeight','lineNumber','lineStyle','lineTo','link','linkColor','links','list','listStyle','listStyleImage','listStylePosition','listStyleType','load','loadMovie','loadMovieNum','loadSound','loadVariables','loadVariablesNum','loaded','localName','localStorage','localToGlobal','localeCompare','location','locationbar','log','logicalXDPI','logicalYDPI','long','longDesc','loop','lowsrc','lt','manufacturer','map','margin','marginBottom','marginHeight','marginLeft','marginRight','marginTop','marginWidth','margins','match','max','maxChars','maxConnectionsPerServer','maxHeight','maxLength','maxWidth','maxhscroll','maxscroll','mbchr','mblength','mbord','mbsubstring','media','menuArguments','menubar','mergeAttributes','message','metaInfo','meth','method','mimeType','mimeTypes','min','minHeight','minWidth','mouseDown','mouseMove','mouseUp','move','moveAbove','moveBelow','moveBy','moveEnd','moveFirst','moveNext','moveRow','moveStart','moveTo','moveToAbsolute','moveToBookmark','moveToElementText','moveToPoint','msBlockProgression','msInterpolationMode','multiline','multiple','name','nameProp','namedItem','namedRecordset','namespace','namespaceURI','namespaces','native','navigate','navigator','ne','netscape','new','newline','next','nextFrame','nextPage','nextScene','nextSibling','noHref','noResize','noShade','now','noWrap','nodeName','nodeType','nodeValue','normalize','not','null','number','object','offscreenBuffering','offsetHeight','offsetLeft','offsetParent','offsetTop','offsetWidth','offsetX','offsetY','on','onAbort','onActivate','onAfterprint','onAfterupdate','onBeforeactivate','onBeforecut','onBeforedeactivate','onBeforeeditfocus','onBeforepaste','onBeforeprint','onBeforeunload','onBeforeupdate','onBlur','onCellchange','onChange','onChanged','onClick','onClipEvent','onClose','onConnect','onContextmenu','onControlselect','onCut','onData','onDataavailable','onDatasetchanged','onDatasetcomplete','onDblclick','onDeactivate','onDrag','onDragOut','onDragOver','onDragdrop','onDragend','onDragenter','onDragleave','onDragover','onDragstart','onDrop','onEnterFrame','onError','onErrorupdate','onFocus','onHelp','onKeyDown','onKeyUp','onKeydown','onKeypress','onKeyup','onKillFocus','onLine','onLoad','onMouseDown','onMouseMove','onMouseUp','onMousedown','onMousemove','onMouseout','onMouseover','onMouseup','onPaste','onPress','onPropertychange','onReadystatechange','onRelease','onReleaseOutside','onReset','onResize','onResizeend','onResizestart','onRollOut','onRollOver','onRowenter','onRowexit','onRowsdelete','onRowsinserted','onScroll','onScroller','onSelect','onSelectionchange','onSelectstart','onSetFocus','onSoundComplete','onStop','onSubmit','onUnload','onXML','onpropertychange','onreadystatechange','onvisibilitychange','open','opener','opsProfile','options','or','ord','origin','orphans','os','oscpu','outerHTML','outerHeight','outerText','outerWidth','outline','outlineColor','outlineStyle','outlineWidth','overflow','overflowX','overflowY','ownerDocument','ownerElement','owningElement','package','padding','paddingBottom','paddingLeft','paddingRight','paddingTop','paddings','page','pageBreakAfter','pageBreakBefore','pageBreakInside','pageX','pageXOffset','pageY','pageYOffset','pages','palette','parent','parentElement','parentLayer','parentNode','parentStyleSheet','parentTextEdit','parentWindow','parse','parseFloat','parseInt','parseXML','password','pasteHTML','pathname','pause','personalbar','pixelAspectRatio','pixelBottom','pixelDepth','pixelHeight','pixelLeft','pixelRight','pixelTop','pixelWidth','pkcs11','platform','play','plugin','plugins','plugins.refresh','pluginspage','pop','popup','port','posBottom','posHeight','posLeft','posRight','posTop','posWidth','position','pow','preference','prefix','press','prevFrame','prevScene','previous','previousPage','previousSibling','print','printAsBitmap','printAsBitmapNum','printNum','private','product','productSub','profile','prompt','prompter','propertyIsEnumerable','propertyName','protected','protocol','prototype','pseudoClass','public','publish','push','qualifier','queryCommandEnabled','queryCommandIndeterm','queryCommandState','queryCommandValue','quote','quotes','random','readOnly','readyState','reason','recalc','receiveAudio','receiveVideo','recordNumber','recordset','reduce','reduceRight','referrer','refresh','registerClass','rel','release','releaseCapture','releaseEvents','releaseOutside','reload','remainingSpace','remove','removeAttribute','removeAttributeNode','removeBehavior','removeChild','removeExpression','removeListener','removeMovieClip','removeNamedItem','removeNode','removeRule','removeTextField','repeat','replace','replaceChild','replaceData','replaceNode','replaceSel','reset','resizeBy','resizeTo','responseBody','responseText','responseXML','restrict','return','returnValue','rev','reverse','right','rightContext','rightMargin','role','rollOut','rollOver','round','routeEvents','rowIndex','rowSpan','rows','rubyAlign','rubyOverhang','rubyPosition','rule','rules','runtimeStyle','seal','savePreferences','saveType','scaleMode','scheme','scope','scopeName','screen','screenColor','screenDPI','screenLeft','screenResolutionX','screenResolutionY','screenTop','screenX','screenY','scripts','scroll','scrollAmount','scrollBy','scrollByLines','scrollByPages','scrollDelay','scrollHeight','scrollIntoView','scrollLeft','scrollString','scrollTo','scrollTop','scrollWidth','scrollX','scrollY','scrollbar','scrollbar3dLightColor','scrollbarArrowColor','scrollbarBaseColor','scrollbarDarkShadowColor','scrollbarFaceColor','scrollbarHighlightColor','scrollbarShadowColor','scrollbarTrackColor','scrollbars','scrolling','search','sectionRowIndex','security','securityPolicy','seek','select','selectable','selectableContent','selected','selectedIndex','selection','selector','selectorText','self','send','sendAndLoad','serverString','sessionStorage','set','setActive','setAttribute','setAttributeNode','setBufferTime','setCapture','setCookie','setCursor','setDate','setDuration','setExpression','setFocus','setFps','setFullYear','setGain','setHotKeys','setHours','setInterval','setKeyFrameInterval','setLoopback','setMask','setMilliseconds','setMinutes','setMode','setMonth','setMotionLevel','setNamedItem','setNewTextFormat','setPan','setPosition','setProperty','setQuality','setRGB','setRate','setRequestHeader','setResizable','setSeconds','setSelection','setSilenceLevel','setTextFormat','setTime','setTimeout','setTransform','setUTCDate','setUTCFullYear','setUTCHours','setUTCMilliseconds','setUTCMinutes','setUTCMonth','setUTCSeconds','setUseEchoSuppression','setVolume','setYear','setZOptions','shape','shift','shiftKey','shiftLeft','short','show','showHelp','showMenu','showModalDialog','showModelessDialog','siblingAbove','siblingBelow','sidebar','signText','sin','size','sizeToContent','slice','small','some','sort','sortOn','source','sourceIndex','span','specified','splice','split','splitText','sqrt','src','srcElement','srcFilter','srcUrn','stack','standby','start','startDrag','static','status','statusText','statusbar','stop','stopAllSounds','stopDrag','strike','stringify','style','styleFloat','styleSheet','styleSheets','sub','submit','substr','substring','substringData','suffixes','summary','sun','sup','super','swapDepths','swapNode','switch','synchronized','systemLanguage','systemXDPI','systemYDPI','tBodies','tFoot','tHead','tabChildren','tabEnabled','tabIndex','tabStop','tabStops','table','tableLayout','tagName','tagUrn','tags','taint','taintEnabled','tan','target','targetPath','tellTarget','test','text','textAlign','textAlignLast','textAutospace','textColor','textDecoration','textDecorationBlink','textDecorationLineThrough','textDecorationNone','textDecorationOverline','textDecorationUnderline','textHeight','textIndent','textJustify','textKashidaSpace','textOverflow','textTransform','textUnderlinePosition','textWidth','textarea','this','throw','throws','timeout','title','toArray','toISOString','toDateString','toElement','toExponential','toFixed','toGMTString','toJSON','toLocaleDateString','toLocaleLowerCase','toLocaleString','toLocaleTimeString','toLocaleUpperCase','toLowerCase','toPrecision','toSource','toString','toTimeString','toUTCString','toUpperCase','toggleHighQuality','toolbar','top','topMargin','trace','trackAsMenu','transient','trim','trimLeft','trimRight','trueSpeed','try','type','typeDetail','typeof','ubound','undefined','underline','unescape','unicodeBidi','uninstall','uniqueID','units','unload','unloadMovie','unloadMovieNum','unshift','untaint','unwatch','updateAfterEvent','updateCommands','updateInterval','url','urn','urns','useHandCursor','useMap','userAgent','userLanguage','userProfile','vAlign','vLink','vLinkcolor','value','valueOf','valueType','var','variable','vcard_name','vendor','vendorSub','version','verticalAlign','viewInheritStyle','viewLink','viewLinkContent','viewMasterTab','visibility','vlinkColor','void','volatile','volume','vrml','vspace','watch','wheelDelta','while','whiteSpace','widows','width','window','with','wordBreak','wordSpacing','wordWrap','wrap','write','writeln','writingMode','x','xmlDecl','y','zIndex','zoom'];
  841.             var props = [];
  842.             for(var i=0;i<jsBuiltInProps.length;i++) {
  843.                 try {
  844.                     eval("if(obj.function::[jsBuiltInProps[i]]) {props.push(jsBuiltInProps[i]);}");
  845.                 } catch(e){}
  846.             }
  847.             this.settings.output.value = props;
  848.         }
  849.         this.testHTML = function(optContent, innerHTML) {
  850.            this.settings.preview.style.display = 'block';
  851.            this.settings.source.style.display = 'block';
  852.            var ifrm = this.settings.iframe.contentWindow.document;                       
  853.            ifrm.open();
  854.             if(optContent == null) {
  855.                 var code = this.settings.output.value;
  856.                 if(window.localStorage) {
  857.                     var history = localStorage.getItem("codeHistory");
  858.                     if(history === null) {
  859.                         localStorage.setItem("codeHistory", encodeURIComponent(code).replace(/'/g,'%27'));
  860.                     } else {
  861.                         history = history+','+encodeURIComponent(code).replace(/'/g,'%27');
  862.                         localStorage.setItem("codeHistory", history);
  863.                     }
  864.                 }
  865.                 if(!innerHTML) {
  866.                     ifrm.writeln('' + code);
  867.                     this.settings.sourceCode.innerHTML = this.encodeForPreview(code);
  868.                 }
  869.             } else {
  870.                 if(!innerHTML) {
  871.                     ifrm.writeln('' + optContent);
  872.                     this.settings.sourceCode.innerHTML = this.encodeForPreview(optContent);
  873.                 }
  874.             }
  875.             ifrm.close();
  876.             if(innerHTML) {
  877.                 ifrm.body.innerHTML = optContent;
  878.                 this.settings.sourceCode.innerHTML = this.encodeForPreview(optContent);
  879.             }
  880.         }
  881.         this.closePreview = function() {
  882.             this.settings.preview.style.display = 'none';
  883.             this.settings.source.style.display = 'none';
  884.             clearInterval(window.toStaticTimer);
  885.         }
  886.         this.closeSource = function() {
  887.             this.settings.source.style.display = 'none';
  888.             this.settings.preview.style.display = 'none';
  889.             clearInterval(window.toStaticTimer);
  890.         }
  891.         this.saveStorage = function(code) {        
  892.             if(window.localStorage) {
  893.                 var history = localStorage.getItem("codeHistory");
  894.                 if(history === null) {
  895.                     localStorage.setItem("codeHistory", encodeURIComponent(code).replace(/'/g,'%27'));
  896.                 } else {                                       
  897.                     history = history+','+encodeURIComponent(code).replace(/'/g,'%27');
  898.                     localStorage.setItem("codeHistory", history);
  899.                 }
  900.             }
  901.         }
  902.         this.testString = function(fresh,alertOutput) {
  903.             var code = this.settings.output.value;
  904.             this.clearErrors();
  905.             if(code == '') {
  906.                 return false;
  907.             }
  908.            
  909.             this.saveStorage(code);
  910.            
  911.             if(fresh) {
  912.                 this.testHTML("<script>function run() { var code=top.Hackvertor.settings.output.value; try {try { throw new Error() } catch(ex) { relativeLineNumber = ex.lineNumber }  evalResult = eval(code);return evalResult;  } catch(ex) {error = ex.message+' (line '+(ex.lineNumber - relativeLineNumber)+')';top.Hackvertor.sendError(error);} }run();<\/script>");
  913.                 return null;
  914.             }
  915.            
  916.             try {
  917.                 try { throw new Error() } catch(ex) { relativeLineNumber = ex.lineNumber }             
  918.                     evalResult = eval(code);                   
  919.                     if(alertOutput) {                  
  920.                         alert('Result:\n'+evalResult + '\nType:\n' + typeof evalResult);
  921.                     }
  922.                     return evalResult;             
  923.             } catch(ex) {
  924.                 error = ex.message+' (line '+(ex.lineNumber - relativeLineNumber)+')';
  925.                 this.sendError(error);
  926.             }  
  927.         }
  928.         this.sendError = function(error) {
  929.             var errorConsole = this.settings.errorConsole;
  930.             errorConsole.style.display = 'block';
  931.             errorConsole.innerHTML = error;
  932.         }
  933.         this.clearErrors = function() {
  934.             var errorConsole = this.settings.errorConsole;
  935.             errorConsole.innerHTML = '';
  936.             errorConsole.style.display = 'none';
  937.         }
  938.         this.addHVURL = function(obj) {
  939.             if(typeof this.hvurls[obj.userID] == 'undefined') {
  940.                 this.hvurls[obj.userID] = [];
  941.             }          
  942.             this.hvurls[obj.userID].push({hvurlID:obj.hvurlID,description:obj.description});           
  943.         }
  944.         this.domScratch = function() {
  945.             this.settings.preview.style.display = 'block';
  946.             this.settings.preview.style.width = '95%';
  947.             this.settings.preview.style.height = '95%';
  948.             this.settings.preview.style.left = '0';
  949.             this.settings.preview.style.top = '0';
  950.             var ifrm = this.settings.iframe.contentWindow.document;                      
  951.             ifrm.open();
  952.             ifrm.write('<!doctype html><html><head><meta http-equiv="Content-Type" content="text/xhtml;charset=utf-8" /><style>#canvas, #canvas2, #html, #log {width:100%;height:190px;overflow-y:scroll}</style></head><body><textarea id="html"></textarea><hr /><div id="canvas"></div><hr /><textarea id="log"></textarea><hr /><div id="canvas2"></div><script>var html = document.getElementById(\'html\');var log = document.getElementById(\'log\');var canvas = document.getElementById(\'canvas\');var canvas2 = document.getElementById(\'canvas2\');var updateCanvas = function(){canvas.innerHTML=html.value;log.value=canvas.innerHTML;canvas2.innerHTML=canvas.innerHTML;};html.onblur=function(){ top.Hackvertor.saveStorage(html.value); };html.onkeyup = updateCanvas;window.onload = updateCanvas;<\/script></body></html>');
  953.             ifrm.close();                      
  954.         }
  955.         this.inspectHTML = function() {
  956.             if(document.getElementById('output').value) {
  957.                 this.saveStorage(document.getElementById('output').value);
  958.             }
  959.             DOM.innerHTML = '';
  960.             DOM.innerHTML = document.getElementById('output').value;       
  961.             astalanumerator.run('document.getElementById(\'DOM\').firstChild');
  962.         }
  963.         this.loadHvurls = function(userID) {
  964.             this.clearSelect(document.getElementById('savedHvurls'));
  965.             var urls = this.hvurls[userID];
  966.             if(typeof urls != 'undefined') {
  967.                 for(var i=0;i<urls.length;i++) {
  968.                     var obj = urls[i];         
  969.                     this.appendSelect(document.getElementById('savedHvurls'), obj.hvurlID, obj.description);               
  970.                 }
  971.             }
  972.         }
  973.         this.hackvertlet = function() {
  974.             var input = this.settings.input;
  975.             if(input.value == '') {
  976.                 input.value = 'Hackvertlet';
  977.                 this.selectInput();
  978.             } else {
  979.                 var hackvertletName = prompt('Please enter a name for your Hackvertlet');
  980.                 if(hackvertletName == null) {
  981.                     return false;
  982.                 }
  983.                 self.location = 'data:text/html,<p>Drag the link below to your bookmarks</p><a href="javascript:txt=document.getSelection();self.location=\'https://hackvertor.co.uk/home#\'+encodeURIComponent(btoa(atob(\''+btoa(input.value)+'\').replace(/Hackvertlet/g,txt)));">'+hackvertletName.replace(/[^!. a-zA-Z0-9_\-]/g,'')+'</a>';
  984.             }
  985.         }
  986.         this.checkHistory = function() {           
  987.             if(window.localStorage) {
  988.                 this.history = localStorage.getItem("codeHistory").split(",");                                 
  989.             }          
  990.             if(this.historyPos === null && this.history.length) {  
  991.                 this.historyPos = this.history.length;
  992.             }                                      
  993.         }
  994.         this.historyClear = function() {
  995.             if(window.localStorage) {
  996.                 localStorage.clear();
  997.             }
  998.         }
  999.         this.historyStart = function() {
  1000.             this.checkHistory();                                   
  1001.             this.settings.output.value = decodeURIComponent(this.history[0]);
  1002.             this.historyPos = 0;
  1003.         }
  1004.         this.historyEnd = function() {         
  1005.             this.checkHistory();                                           
  1006.             this.settings.output.value = decodeURIComponent(this.history[this.history.length-1]);
  1007.             this.historyPos = this.history.length-1;
  1008.         }
  1009.         this.historyBack = function() {        
  1010.             this.checkHistory();                   
  1011.             if(this.historyPos !== null && this.historyPos > 0) {              
  1012.                 this.settings.output.value = decodeURIComponent(this.history[--this.historyPos]);              
  1013.             }
  1014.         }
  1015.         this.historyForward = function() {         
  1016.             this.checkHistory();
  1017.             if(this.historyPos !== null && this.historyPos + 1 < this.history.length) {                                
  1018.                 this.settings.output.value = decodeURIComponent(this.history[++this.historyPos]);              
  1019.             }
  1020.         }
  1021.         this.scanTags = function() {
  1022.             var tagsList = ['video','time','source','section','rule','progress','output','nest','nav','meter','m','header','footer','figure','event-source','datatemplate','datalist','datagrid','command','colgroup','canvas','audio','aside','article','embed','a','abbr','acronym','address','applet','area','b','base','bdo','big','body','br','button','caption','center','cite','code','col','dd','del','dfn','dir','div','dl','dt','em','font','form','frame','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','isindex','kbd','label','legend','li','link','map','menu','meta','object','ol','option','p','param','pre','q','s','samp','script','select','small','span','strike','strong','style','sub','sup','table','tbody','td','tfoot','th','thead','title','tr','tt','u','ul','var','blink','marquee','!doctype','basefont','bgsound','blockquote','fieldset','frameset','ilayer','image','keygen','listing','multicol','nobr','noembed','noframes','noscript','nolayer','optgroup','rb','rbc','rp','rtc','rt','ruby','spacer','textarea','wbr','xml','xmp'].sort(),
  1023.                 val = this.settings.output.value, i, tag, found = [];          
  1024.             for(i=0;i<tagsList.length;i++) {
  1025.                 tag = tagsList[i];
  1026.                 try {
  1027.                     if(document.createElement(tag)[val] !== undefined) {
  1028.                         found.push(tag);
  1029.                     }
  1030.                 } catch(e){}
  1031.             }
  1032.             this.settings.output.value = found;
  1033.         }
  1034.         this.propertyFuzzer = function() {
  1035.             var html = '<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><\/head><body>';
  1036.             html += '<script>self.results=[];<\/script>';
  1037.             html += '<script>window.onload=function(){if(self.results.length) {top.document.getElementById("output").value = self.results.join(",");} else {top.document.getElementById("output").value = "No results found.";}}<\/script>';
  1038.             for(var i=1;i<0xffff;i++) {                            
  1039.                 html += '<script>if(typeof self["alert'+String.fromCharCode(i)+'"]=="function"){results.push('+i+')}<\/script>';               
  1040.             }  
  1041.             html += '<script>if(typeof self["alert'+String.fromCharCode(0)+'"]=="function"){results.push('+0+')}<\/script><\/body><\/html>';
  1042.             var ifrm = this.settings.iframe.contentWindow.document;                      
  1043.             ifrm.open();
  1044.             ifrm.write(html);
  1045.             ifrm.close();
  1046.         }
  1047.         this.tagFuzzer = function() {
  1048.             var tagsList = ['video','time','source','section','rule','progress','output','nest','nav','meter','m','header','footer','figure','event-source','datatemplate','datalist','datagrid','command','colgroup','canvas','audio','aside','article','embed','a','abbr','acronym','address','applet','area','b','base','bdo','big','body','br','button','caption','center','cite','code','col','dd','del','dfn','dir','div','dl','dt','em','font','form','frame','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','isindex','kbd','label','legend','li','link','map','menu','meta','object','ol','option','p','param','pre','q','s','samp','script','select','small','span','strike','strong','style','sub','sup','table','tbody','td','tfoot','th','thead','title','tr','tt','u','ul','var','blink','marquee','!doctype','basefont','bgsound','blockquote','fieldset','frameset','ilayer','image','keygen','listing','multicol','nobr','noembed','noframes','noscript','nolayer','optgroup','rb','rbc','rp','rtc','rt','ruby','spacer','textarea','wbr','xml','xmp'].sort(),
  1049.                 attributes = ['onfocus','onstart','poster','onload','onerror','onreadystatechange','data','href','src','background','DYNSRC','LOWSRC'], html = '', tag, i, j,
  1050.                 ifrm = this.settings.iframe.contentWindow.document;
  1051.             html = '<script>logged = {};results = [];function logResults(tag, attribute){ if(logged[tag+""+attribute]){return false;};results.push({tag:tag,attribute:attribute});logged[tag+""+attribute]=1; }<\/script>';                
  1052.             html += '<div id="container"></div>';
  1053.             html += '<div style="position:absolute;left:-5000px;">';
  1054.             for(i=0;i<tagsList.length;i++) {
  1055.                 tag = tagsList[i];
  1056.                 html += '\'"><'+tag + ' type="text/javascript"';
  1057.                 for(j=0;j<attributes.length;j++) {
  1058.                     if(attributes[j] === 'src' && tag === 'iframe') {
  1059.                         html += ' ' + attributes[j] + '="javascript:parent.logResults('+i+','+j+')"';
  1060.                     } else {
  1061.                         html += ' ' + attributes[j] + '="javascript:logResults('+i+','+j+')"';
  1062.                     }
  1063.                 }
  1064.                 html += '>test'+'</'+tag+'>';
  1065.                 /*
  1066.                 html += '\'"><'+tag + ' type="text/html"';
  1067.                 for(j=0;j<attributes.length;j++) {
  1068.                     if(/^on/.test(attributes[j])) {
  1069.                         continue;
  1070.                     }
  1071.                     html += ' ' + attributes[j] + '="data:text/html,<script>parent.logResults('+i+','+j+')<\/script>"';                
  1072.                 }
  1073.                 html += '>test'+'</'+tag+'>';
  1074.                 */
  1075.             }          
  1076.             html += '</div>';
  1077.             html += "<script>window.onload=function(){ var html = '', tagsList = '"+tagsList.join(',')+"'.split(','),attributes = '"+attributes.join(',')+"'.split(',');html += '<style>*{font-size:12px;font-family: \"Lucida Grande\", verdana, arial, helvetica, sans-serif;}table {width:100%;}td{border:1px solid #ccc;}th{text-align:left;background-color:#}tr.row1{background-color:#EDF6F7;}tr.row2{background-color:#EDF1F7;}</style>';html += '<table><tr class=\"row1\"><th>Tag</th><th>Attribute</th></tr>';for(var i=0;i<results.length;i++){ html+='<tr class=\"row2\"><td>'+tagsList[results[i].tag]+'</td><td>'+attributes[results[i].attribute]+'</td></tr>'; };html+='</table>';setTimeout(function(html) { return function(){ document.getElementById('container').innerHTML=html; } }(html), 500); }<\/script>";                                      
  1078.             ifrm.write(html);
  1079.             ifrm.close();                  
  1080.             this.settings.preview.style.width = '80%';
  1081.             this.settings.preview.style.height = '80%';
  1082.             this.settings.preview.style.display = 'block';
  1083.            
  1084.         }
  1085.         this.urlFuzzer = function() {
  1086.             var a = document.createElement('a'), html = '', i,
  1087.                 beforeSlashes = [], middleSlashes = [], afterSlashes = [],
  1088.                 middleHttp = [], oneSlash = [], noSlashes = [], beforeHttp = [], afterHttp = [],
  1089.                 beforeColon = [], middleJavascript = [], startJavascript = [],
  1090.                 beforeFile = [], repeatedFile = [], beforeColonFile = [], beforeSemi = [], beforeEntColon = [];
  1091.             html += '<style>textarea{width:350px;height:100px;}*{font-size:12px;font-family: "Lucida Grande", verdana, arial, helvetica, sans-serif;}table {width:100%;}td{border:1px solid #ccc;}th{text-align:left;background-color:#}tr.row1{background-color:#EDF6F7;}tr.row2{background-color:#EDF1F7;}</style>';
  1092.             html += '<table>';
  1093.             html += '<tr class="row1">';           
  1094.             html += '<th>Type</th>';
  1095.             html += '<th>Position</th>';
  1096.             html += '<th>Sample</th>';
  1097.             html += '<th>Chars</th>';
  1098.             html += '</tr>';
  1099.             for(i=0;i<0xffff;i++) {
  1100.                 try {
  1101.                     a.href=String.fromCharCode(i)+'//x';
  1102.                     if(a.host === 'x') {
  1103.                         beforeSlashes.push(i);
  1104.                     }
  1105.                     a.href='/'+String.fromCharCode(i)+'/x';
  1106.                     if(a.host === 'x') {
  1107.                         middleSlashes.push(i);
  1108.                     }
  1109.                     a.href='//'+String.fromCharCode(i)+'x';
  1110.                     if(a.host === 'x') {
  1111.                         afterSlashes.push(i);
  1112.                     }
  1113.                     a.href='http:/'+String.fromCharCode(i)+'x';
  1114.                     if(a.host === 'x') {
  1115.                         oneSlash.push(i);
  1116.                     }
  1117.                     a.href='http:'+String.fromCharCode(i)+'x';
  1118.                     if(a.host === 'x') {
  1119.                         noSlashes.push(i);
  1120.                     }
  1121.                     a.href=''+String.fromCharCode(i)+'http://x';
  1122.                     if(a.host === 'x') {
  1123.                         beforeHttp.push(i);
  1124.                     }
  1125.                     a.href='http://'+String.fromCharCode(i)+'x';
  1126.                     if(a.host === 'x') {
  1127.                         afterHttp.push(i);
  1128.                     }
  1129.                     a.href='http:/'+String.fromCharCode(i)+'/x';
  1130.                     if(a.host === 'x') {
  1131.                         middleHttp.push(i);
  1132.                     }                                  
  1133.                     a.href=''+String.fromCharCode(i)+'file://x';
  1134.                     if(a.protocol === 'file:') {
  1135.                         beforeFile.push(i);
  1136.                     }
  1137.                     a.href=''+String.fromCharCode(i)+'://x';
  1138.                     if(a.protocol === 'file:') {
  1139.                         beforeColonFile.push(i);
  1140.                     }
  1141.                     a.href = String.fromCharCode(i)+String.fromCharCode(i)+'/x';
  1142.                     if(a.protocol === 'file:') {
  1143.                         repeatedFile.push(i);
  1144.                     }
  1145.                    
  1146.                     a.href='javascript'+String.fromCharCode(i)+':';
  1147.                     if(a.protocol === 'javascript:') {
  1148.                         beforeColon.push(i);
  1149.                     }
  1150.                     a.href='javas'+String.fromCharCode(i)+'cript:';
  1151.                     if(a.protocol === 'javascript:') {
  1152.                         middleJavascript.push(i);
  1153.                     }
  1154.                     a.href=''+String.fromCharCode(i)+'javascript:';
  1155.                     if(a.protocol === 'javascript:') {
  1156.                         startJavascript.push(i);
  1157.                     }
  1158.                     try {                      
  1159.                         var span=document.createElement('span');
  1160.                         span.innerHTML='<a href="javascript&colon'+String.fromCharCode(i)+';">test</a>';                       
  1161.                         if(span.firstChild.protocol === 'javascript:') {
  1162.                             beforeSemi.push(i);
  1163.                         }
  1164.                         span.innerHTML='<a href="javascript&'+String.fromCharCode(i)+'colon;">test</a>';                       
  1165.                         if(span.firstChild.protocol === 'javascript:') {
  1166.                             beforeEntColon.push(i);
  1167.                         }
  1168.                     } catch(e){};                  
  1169.                    
  1170.                 } catch(e) {}
  1171.             }
  1172.             html += '<tr class="row2">';
  1173.             html += '<td>//</td>';
  1174.             html += '<td>Before slashes</td>';
  1175.             html += '<td>CHAR//</td>';
  1176.             html += '<td><textarea>'+beforeSlashes.join(',')+'</textarea></td>';
  1177.             html += '</tr>';
  1178.             html += '<tr class="row2">';
  1179.             html += '<td>//</td>';
  1180.             html += '<td>Middle of slashes</td>';
  1181.             html += '<td>/CHAR/</td>';
  1182.             html += '<td><textarea>'+middleSlashes.join(',')+'</textarea></td>';
  1183.             html += '</tr>';
  1184.             html += '<tr class="row2">';
  1185.             html += '<td>//</td>';
  1186.             html += '<td>After slashes</td>';
  1187.             html += '<td>//CHAR</td>';
  1188.             html += '<td><textarea>'+afterSlashes.join(',')+'</textarea></td>';
  1189.             html += '</tr>';
  1190.             html += '<tr class="row2">';
  1191.             html += '<td>http:</td>';
  1192.             html += '<td>One slash</td>';
  1193.             html += '<td>http:/CHAR</td>';
  1194.             html += '<td><textarea>'+oneSlash.join(',')+'</textarea></td>';
  1195.             html += '</tr>';
  1196.             html += '<tr class="row2">';
  1197.             html += '<td>http:</td>';
  1198.             html += '<td>No slashes</td>';
  1199.             html += '<td>http:CHAR</td>';
  1200.             html += '<td><textarea>'+noSlashes.join(',')+'</textarea></td>';
  1201.             html += '</tr>';
  1202.             html += '<tr class="row2">';
  1203.             html += '<td>http:</td>';
  1204.             html += '<td>Before http</td>';
  1205.             html += '<td>CHARhttp://</td>';
  1206.             html += '<td><textarea>'+beforeHttp.join(',')+'</textarea></td>';
  1207.             html += '</tr>';
  1208.             html += '<tr class="row2">';
  1209.             html += '<td>http:</td>';
  1210.             html += '<td>After http</td>';
  1211.             html += '<td>http://CHAR</td>';
  1212.             html += '<td><textarea>'+afterHttp.join(',')+'</textarea></td>';
  1213.             html += '</tr>';
  1214.             html += '<tr class="row2">';
  1215.             html += '<td>http:</td>';
  1216.             html += '<td>Middle http slashes</td>';
  1217.             html += '<td>http:/CHAR/</td>';
  1218.             html += '<td><textarea>'+middleHttp.join(',')+'</textarea></td>';
  1219.             html += '</tr>';
  1220.                                
  1221.             html += '<tr class="row2">';
  1222.             html += '<td>file:</td>';
  1223.             html += '<td>Before colon:</td>';
  1224.             html += '<td>CHAR:</td>';
  1225.             html += '<td><textarea>'+beforeColonFile.join(',')+'</textarea></td>';
  1226.             html += '</tr>';
  1227.             html += '<tr class="row2">';
  1228.             html += '<td>file:</td>';
  1229.             html += '<td>Before file:</td>';
  1230.             html += '<td>CHARfile://</td>';
  1231.             html += '<td><textarea>'+beforeFile.join(',')+'</textarea></td>';
  1232.             html += '</tr>';       
  1233.             html += '<tr class="row2">';
  1234.             html += '<td>file:</td>';
  1235.             html += '<td>Two characters</td>';
  1236.             html += '<td>CHARCHAR/</td>';
  1237.             html += '<td><textarea>'+repeatedFile.join(',')+'</textarea></td>';
  1238.             html += '</tr>';
  1239.            
  1240.             html += '<tr class="row2">';
  1241.             html += '<td>javascript:</td>';
  1242.             html += '<td>Before Colon</td>';
  1243.             html += '<td>javascriptCHAR:</td>';
  1244.             html += '<td><textarea>'+beforeColon.join(',')+'</textarea></td>';
  1245.             html += '</tr>';
  1246.             html += '<tr class="row2">';
  1247.             html += '<td>javascript:</td>';
  1248.             html += '<td>Middle of javascript</td>';
  1249.             html += '<td>javasCHARcript:</td>';
  1250.             html += '<td><textarea>'+middleJavascript.join(',')+'</textarea></td>';
  1251.             html += '</tr>';
  1252.             html += '<tr class="row2">';
  1253.             html += '<td>javascript:</td>';
  1254.             html += '<td>Start of javascript</td>';
  1255.             html += '<td>CHARjavascript:</td>';
  1256.             html += '<td><textarea>'+startJavascript.join(',')+'</textarea></td>';         
  1257.             html += '</tr>';
  1258.             html += '<tr class="row1">';
  1259.             html += '<td>javascript&amp;colon;</td>';
  1260.             html += '<td>Before semi-colon of &amp;colon;</td>';
  1261.             html += '<td>javascript&amp;colonCHAR;</td>';
  1262.             html += '<td><textarea>'+beforeSemi.join(',')+'</textarea></td>';          
  1263.             html += '</tr>';
  1264.             html += '<tr class="row2">';
  1265.             html += '<td>javascript&amp;colon;</td>';
  1266.             html += '<td>Before c of &amp;colon;</td>';
  1267.             html += '<td>javascript&amp;CHARcolon;</td>';
  1268.             html += '<td><textarea>'+beforeEntColon.join(',')+'</textarea></td>';          
  1269.             html += '</tr>';
  1270.             html += '</table>';
  1271.             var ifrm = this.settings.iframe.contentWindow.document;                      
  1272.             ifrm.open();
  1273.             ifrm.writeln(html);
  1274.             ifrm.close();          
  1275.             this.settings.preview.style.width = '80%';
  1276.             this.settings.preview.style.height = '80%';
  1277.             this.settings.preview.style.display = 'block';         
  1278.         }
  1279.         this.jsCheck = function() {
  1280.             var response = ''; 
  1281.             response += '---RegEx flags---\n';
  1282.             for(var i=0;i<0xffff;i++) {
  1283.                 try {
  1284.                     eval("new RegExp('a','"+String.fromCharCode(i)+"');");
  1285.                     response += String.fromCharCode(i)+'\n';
  1286.                 } catch(e){}
  1287.             }
  1288.             response += '---Use strict---\n';
  1289.             (function(){               
  1290.                 "use strict";
  1291.                 try {
  1292.                     eval("with({}){}");
  1293.                     response += 'with:' + true+'\n';
  1294.                 } catch(e){
  1295.                     response += 'with:' + false+'\n';
  1296.                 }
  1297.                 try {
  1298.                     eval("x=1");
  1299.                     response += 'eval can assign:' + true+'\n';
  1300.                 } catch(e){
  1301.                     response += 'eval can assign:' + false+'\n';
  1302.                 }
  1303.                
  1304.                 response += 'this is:' + (function(){ "use strict";return this; })()+'\n';
  1305.                 response += 'this call is:' + (function(){ "use strict";return this; }).call()+'\n';
  1306.                 response += 'this apply is:' + (function(){ "use strict";return this; }).apply()+'\n';
  1307.                 try {
  1308.                     eval("({a:1,a:1})");
  1309.                     response += 'duplicate object props:' + true+'\n';
  1310.                 } catch(e){
  1311.                     response += 'duplicate object props:' + false+'\n';
  1312.                 }
  1313.                 try {
  1314.                     eval('(function(){ "use strict";arguments.callee; })();');
  1315.                     response += 'arguments.callee:' + true+'\n';
  1316.                 } catch(e){
  1317.                     response += 'arguments.callee:' + false+'\n';
  1318.                 }
  1319.                 try {
  1320.                     eval('(function(){ "use strict";arguments.caller; })();');
  1321.                     response += 'arguments.caller:' + true+'\n';
  1322.                 } catch(e){
  1323.                     response += 'arguments.caller:' + false+'\n';
  1324.                 }
  1325.                 try {
  1326.                     response += 'octals:' + eval('(function(){ "use strict";return 010!==10; })()')+'\n';
  1327.                 } catch(e) {
  1328.                     response += 'octals:false';
  1329.                 }
  1330.                
  1331.                 try {
  1332.                     response += eval('(function(){ "use strict";function x(){};delete x;})()')+'\n';                                       
  1333.                     response += 'delete on variables/func:' + true+'\n';
  1334.                 } catch(e){
  1335.                     response += 'delete on variables/func:' + false+'\n';
  1336.                 }
  1337.                
  1338.             })();
  1339.             response += '---E4X---\n';
  1340.             response += 'Variables:';
  1341.             try {
  1342.                 eval('x=<test></test>');
  1343.                 response += 'true';
  1344.             } catch(e) {
  1345.                 response += 'false';
  1346.             }
  1347.             response +='\n';
  1348.             response += 'Inline:';
  1349.             try {
  1350.                 eval('<test></test>');
  1351.                 response += 'true';
  1352.             } catch(e) {
  1353.                 response += 'false';
  1354.             }
  1355.             response +='\n';               
  1356.             response += '---Variables---\n';   
  1357.             response += 'constants:';
  1358.             try {
  1359.                 eval("const XXYYZZ=1;");
  1360.                 response += 'true';
  1361.             } catch(e) {
  1362.                 response += 'false';
  1363.             }
  1364.             response += '\n';
  1365.             response += '---Objects---\n';     
  1366.             response += '.create:' + (Object.create?true:false)+'\n';
  1367.             response += '.preventExtensions:' + (Object.preventExtensions?true:false)+'\n';
  1368.             response += '.seal:' + (Object.seal?true:false)+'\n';
  1369.             response += '.isSealed:' + (Object.isSealed?true:false)+'\n';
  1370.             response += '.freeze:' + (Object.freeze?true:false)+'\n';
  1371.             response += '.isFrozen:' + (Object.isFrozen?true:false)+'\n';
  1372.             response += '.isExtensible:' + (Object.isExtensible?true:false)+'\n';
  1373.             response += '.getOwnPropertyDescriptor:' + (Object.getOwnPropertyDescriptor?true:false)+'\n';
  1374.             response += '.keys:' + (Object.keys?true:false)+'\n';
  1375.             response += '.valueOf:' + (({}).valueOf?true:false)+'\n';
  1376.             response += '.toSource:' + (({}).toSource?true:false)+'\n';
  1377.             response += '.toString:' + (({}).toString?true:false)+'\n';                            
  1378.             response += '---Functions---\n';
  1379.             response += '.name:' + ((function x(){}).name?true:false)+'\n';
  1380.             response += '.callee:' + ((function(){ try {return arguments.callee ? true : false;}catch(e){return false;} })())+'\n';            
  1381.             response += '.caller:' + ((function(){ try {return arguments.callee.caller ? true : false;}catch(e){return false;} })())+'\n';
  1382.             response += 'unicode encoding:';
  1383.             try {
  1384.                 eval("function x(){};\\u0078()");
  1385.                 response += 'true';
  1386.             } catch(e) {
  1387.                 response += 'false';
  1388.             }                          
  1389.             response += '\n';
  1390.             response += 'unicode encode parenthesis?:';
  1391.             try {
  1392.                 eval("function x(){};\\u0078\\u0028\\u0029");
  1393.                 response += 'true';
  1394.             } catch(e) {
  1395.                 response += 'false';
  1396.             }                          
  1397.             response += '\n';
  1398.             response += 'setter function x(){}:';
  1399.             try {
  1400.                 eval("setter function x(){}");
  1401.                 response += 'true';                
  1402.             } catch(e) {
  1403.                 response += 'false';
  1404.             }
  1405.             response += '\n';
  1406.             response += 'getter function x(){}:';
  1407.             try {
  1408.                 eval("getter function x(){}");
  1409.                 response += 'true';                
  1410.             } catch(e) {
  1411.                 response += 'false';
  1412.             }
  1413.             response += '\n';
  1414.             response += 'function get x(){}:';
  1415.             try {
  1416.                 eval("function get x(){}");
  1417.                 response += 'true';                
  1418.             } catch(e) {
  1419.                 response += 'false';
  1420.             }
  1421.             response += '\n';              
  1422.             response += 'function set x(){}:';
  1423.             try {
  1424.                 eval("function set x(){}");
  1425.                 response += 'true';                
  1426.             } catch(e) {
  1427.                 response += 'false';
  1428.             }
  1429.             response += '\n';                                                                                                                      
  1430.             response += '---Arrays---\n';              
  1431.             response += 'indexOf():' + ([].indexOf?true:false)+'\n';
  1432.             response += 'lastIndexOf():' + ([].lastIndexOf?true:false)+'\n';               
  1433.             response += 'every():' + ([].every?true:false)+'\n';
  1434.             response += 'filter():' + ([].filter?true:false)+'\n';
  1435.             response += 'forEach():' + ([].forEach?true:false)+'\n';                               
  1436.             response += 'map():' + ([].map?true:false)+'\n';
  1437.             response += 'some():' + ([].some?true:false)+'\n';
  1438.             response += 'reduce():' + ([].reduce?true:false)+'\n';
  1439.             response += 'reduceRight():' + ([].reduceRight?true:false)+'\n';               
  1440.            
  1441.             response += '---Strings---\n';
  1442.             response += 'String Indexes:' + ('test'[0]=='t')+'\n';
  1443.             response += '---Getters/Setters---\n';
  1444.             response += '__defineGetter__:' + (window.__defineGetter__?true:false)+'\n';
  1445.             response += '__defineSetter__:' + (window.__defineSetter__?true:false)+'\n';               
  1446.             response += '__lookupGetter__:' + (window.__lookupGetter__?true:false)+'\n';                               
  1447.             response += '__lookupSetter__:' + (window.__lookupSetter__?true:false)+'\n';
  1448.             response += 'Object.defineProperty:' + (Object.defineProperty?true:false)+'\n';
  1449.             response += 'Object.defineProperties:' + (Object.defineProperties?true:false)+'\n';
  1450.             response += '---IE specific---\n';             
  1451.             response += 'toStaticHTML():' + (window.toStaticHTML?true:false)+'\n';                                                             
  1452.             response += '---Destructuring assignments---\n';
  1453.             response += 'Arrays:';
  1454.             try {
  1455.                 eval('var a = 1;var b = 2;[a, b]=[b, a];');
  1456.                 response += 'true';                
  1457.             } catch(e) {
  1458.                 response += 'false';
  1459.             }
  1460.             response +='\n';       
  1461.             response += 'Assignment correct?:';                                
  1462.             try {
  1463.                 response += a == 2 && b == 1 ? true : false;
  1464.             } catch(e) { response += 'false'; }
  1465.             response +='\n';       
  1466.             response += '---Expression closures---\n';
  1467.             response += 'Variable:';
  1468.             try {
  1469.                 eval('var x=function(x) x * x;');
  1470.                 response += 'true';                
  1471.             } catch(e) {
  1472.                 response += 'false';
  1473.             }  
  1474.             response +='\n';       
  1475.             response += 'Inline:';
  1476.             try {
  1477.                 eval('function(x) x * x;');
  1478.                 response += 'true';                
  1479.             } catch(e) {
  1480.                 response += 'false';
  1481.             }                      
  1482.             response +='\n';   
  1483.             response += '---DOM prototypes overwrites __syntax___---\n';
  1484.             response += 'location:';
  1485.             try {
  1486.                 eval("window.__defineGetter__('location',function() { return 'Overwrite' });overwrite=location=='Overwrite'?true:false;");
  1487.             } catch(e) { overwrite = false; };
  1488.             response += ''+overwrite+'\n';
  1489.  
  1490.             response += 'location.hash:';
  1491.             try {
  1492.                 eval("location.__defineGetter__('hash',function() { return 'Overwrite' });overwrite=location.hash=='Overwrite'?true:false;");
  1493.             } catch(e) { overwrite = false; };
  1494.             response += ''+overwrite+'\n';
  1495.             response += 'location.host:';
  1496.             try {
  1497.                 eval("location.__defineGetter__('host',function() { return 'Overwrite' });overwrite=location.host=='Overwrite'?true:false;");
  1498.             } catch(e) { overwrite = false; };
  1499.             response += ''+overwrite+'\n';
  1500.             response += 'location.hostname:';
  1501.             try {
  1502.                 eval("location.__defineGetter__('hostname',function() { return 'Overwrite'});overwrite=location.hostname=='Overwrite'?true:false;");
  1503.             } catch(e) { overwrite = false; };
  1504.             response += ''+overwrite+'\n';
  1505.             response += 'location.href:';
  1506.             try {
  1507.                 eval("location.__defineGetter__('href',function() { return 'Overwrite' });overwrite=location.href=='Overwrite'?true:false;");
  1508.             } catch(e) { overwrite = false; };
  1509.             response += ''+overwrite+'\n';
  1510.             response += 'location.search:';
  1511.             try {
  1512.                 eval("location.__defineGetter__('search',function() { return 'Overwrite' });overwrite=location.search=='Overwrite'?true:false;");
  1513.             } catch(e) { overwrite = false; };
  1514.             response += ''+overwrite+'\n';
  1515.  
  1516.             response += 'document.domain:';
  1517.             try {
  1518.                 eval("document.__defineGetter__('domain',function() { return 'Overwrite' });overwrite=document.domain=='Overwrite'?true:false;");
  1519.             } catch(e) { overwrite = false; };
  1520.             response += ''+overwrite+'\n';
  1521.  
  1522.             response += 'document.referrer:';
  1523.             try {
  1524.                 eval("document.__defineGetter__('referrer',function() { return 'Overwrite' });overwrite=document.referrer=='Overwrite'?true:false;");
  1525.             } catch(e) { overwrite = false; };
  1526.             response += ''+overwrite+'\n';
  1527.  
  1528.  
  1529.             response += 'document.URL:';
  1530.             try {
  1531.                 eval("document.__defineGetter__('URL',function() { return 'Overwrite' });overwrite=document.URL=='Overwrite'?true:false;");
  1532.             } catch(e) { overwrite = false; };
  1533.             response += ''+overwrite+'\n';
  1534.  
  1535.             response += 'navigator.userAgent:';
  1536.             try {
  1537.                 eval("navigator.__defineGetter__('userAgent',function() { return 'Overwrite' });overwrite=navigator.userAgent=='Overwrite'?true:false;");
  1538.             } catch(e) { overwrite = false; };
  1539.             response += ''+overwrite+'\n';
  1540.  
  1541.             response += '---DOM prototypes overwrites defineProperty---\n';
  1542.             response += 'location:';                                                                                               
  1543.             try {
  1544.                 eval("Object.defineProperty(window,'location',{get:function(){ return 'Overwrite';}});overwrite=location=='Overwrite'?true:false;");
  1545.             } catch(e) { overwrite = false; };
  1546.             response += ''+overwrite+'\n';
  1547.  
  1548.             response += 'location.hash:';                                                                                              
  1549.             try {
  1550.                 eval("Object.defineProperty(location,'hash',{get:function(){ return 'Overwrite';}});overwrite=location.hash=='Overwrite'?true:false;");
  1551.             } catch(e) { overwrite = false; };
  1552.             response += ''+overwrite+'\n';
  1553.             response += 'location.host:';
  1554.             try {
  1555.                 eval("Object.defineProperty(location,'host',{get:function(){ return 'Overwrite';}});overwrite=location.host=='Overwrite'?true:false;");
  1556.             } catch(e) { overwrite = false; };
  1557.             response += ''+overwrite+'\n';
  1558.             response += 'location.hostname:';
  1559.             try {
  1560.                 eval("Object.defineProperty(location,'hostname',{get:function(){ return 'Overwrite';}});overwrite=location.hostname=='Overwrite'?true:false;");
  1561.             } catch(e) { overwrite = false; };
  1562.             response += ''+overwrite+'\n';
  1563.             response += 'location.href:';
  1564.             try {
  1565.                 eval("Object.defineProperty(location,'href',{get:function(){ return 'Overwrite';}});overwrite=location.href=='Overwrite'?true:false;");
  1566.             } catch(e) { overwrite = false; };
  1567.             response += ''+overwrite+'\n';
  1568.             response += 'location.search:';
  1569.             try {
  1570.                 eval("Object.defineProperty(location,'search',{get:function(){ return 'Overwrite';}});overwrite=location.search=='Overwrite'?true:false;");
  1571.             } catch(e) { overwrite = false; };
  1572.             response += ''+overwrite+'\n';
  1573.  
  1574.             response += 'document.domain:';
  1575.             try {
  1576.                 eval("Object.defineProperty(document,'domain',{get:function(){ return 'Overwrite';}});overwrite=document.domain=='Overwrite'?true:false;");
  1577.             } catch(e) { overwrite = false; };
  1578.             response += ''+overwrite+'\n';
  1579.  
  1580.             response += 'document.referrer:';
  1581.             try {
  1582.                 eval("Object.defineProperty(document,'referrer',{get:function(){ return 'Overwrite';}});overwrite=document.referrer=='Overwrite'?true:false;");
  1583.             } catch(e) { overwrite = false; };
  1584.             response += ''+overwrite+'\n';
  1585.  
  1586.  
  1587.             response += 'document.URL:';
  1588.             try {
  1589.                 eval("Object.defineProperty(document,'URL',{get:function(){ return 'Overwrite';}});overwrite=document.URL=='Overwrite'?true:false;");
  1590.             } catch(e) { overwrite = false; };
  1591.             response += ''+overwrite+'\n';
  1592.  
  1593.             response += 'navigator.userAgent:';
  1594.             try {
  1595.                 eval("Object.defineProperty(navigator,'userAgent',{get:function(){ return 'Overwrite';}});overwrite=navigator.userAgent=='Overwrite'?true:false;");
  1596.             } catch(e) { overwrite = false; };
  1597.             response += ''+overwrite+'\n';
  1598.            
  1599.             window.Hackvertor.settings.output.value=response;
  1600.         }
  1601.     }          
  1602.     window.Hackvertor = new Hackvertor;
  1603. })();
Add Comment
Please, Sign In to add comment