tamtailoc

goi y

Dec 14th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Auto suggest
  3. // @description Auto suggest
  4. // @include https://*.facebook.com/*
  5. // @include https://*.facebook.com/*/*
  6. // @include http://*.facebook.com/*
  7. // @include http://*.facebook.com/*/*
  8. // ==/UserScript==
  9.  
  10. function autoSuggest()
  11. {
  12. links=document.getElementsByTagName('a');
  13. for (i in links) {
  14. l=links[i];
  15. if(l.innerHTML == '<span class="uiButtonText">Gợi ý bạn bè</span>') {
  16. l.click();
  17. }
  18. }
  19. }
  20.  
  21. function blub()
  22. {
  23. if(document.getElementsByClassName('pbm fsm').length == 1) {
  24. w = document.getElementsByClassName('pbm fsm')[0];
  25.  
  26. e = document.createElement('a');
  27. //e.href = '#';
  28. e.innerHTML = 'By Lee Seven';
  29. e.className = 'uiButton';
  30. e.onclick = autoSuggest;
  31.  
  32. if( w.childElementCount == 0)
  33. {
  34. w.appendChild(document.createElement('br'));
  35. w.appendChild(e);
  36. }
  37. }
  38. }
  39.  
  40. blub();
  41.  
  42. document.addEventListener("DOMNodeInserted", blub, true);
Add Comment
Please, Sign In to add comment