Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <script>
  2. function setCookie(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));var expires="expires="+d.toUTCString();document.cookie=cname+"="+ cvalue+"; "+ expires;}
  3. function getCookie(cname){var name=cname+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1);}
  4. if(c.indexOf(name)==0){return c.substring(name.length,c.length);}}return"";}
  5. var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
  6. var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
  7. var installed = getCookie("installed");
  8. var failed = getCookie("faild");
  9. if (failed == '3') {
  10.  
  11. } else {
  12. if (installed == '') {
  13. if(isChrome && !isMobile){
  14. function play(){
  15. alert('על מנת לצפות באיכות HD אנא הורידו את התוסף שלנו ');
  16. chrome.webstore.install('',success,fail);
  17. }
  18. }
  19. }
  20. }
  21.  
  22.  
  23. function fail(){
  24. setCookie("failed",3,1)
  25. console.log('Coockie Failed Updated');
  26. location.reload();
  27.  
  28.  
  29. }
  30.  
  31. function success(){
  32. setCookie("installed",1,1);
  33. console.log('Coockie Installed Updated');
  34. location.reload();
  35.  
  36. }
  37.  
  38.  
  39.  
  40. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement