MirkoLoader

Automatycznie pokazuje nowe wpisy na mirko.

  1. // ==UserScript==
  2. // @name MirkoLoader
  3. // @description Automatycznie pokazuje nowe wpisy na mirko.
  4. // @namespace
  5. // @include http://www.wykop.pl/mikroblog*
  6. // @include http://www.wykop.pl/tag*
  7. // @include http://www.wykop.pl/moj*
  8. // @grant none
  9. // @version 1.0
  10. // @run-atdocument-end
  11. // ==/UserScript==
  12.  
  13. function main() {
  14. $('div#newEntriesCounter').hide();
  15. $(document).ajaxComplete(function() {
  16. $('div#newEntriesCounter').find('a.ajax').trigger('click')
  17. });
  18. }
  19.  
  20. if (typeof $ == 'undefined') {
  21. if (typeof unsafeWindow !== 'undefined' && unsafeWindow.jQuery) {
  22. // Firefox
  23. var $ = unsafeWindow.jQuery;
  24. main();
  25. } else {
  26. // Chrome
  27. addJQuery(main);
  28. }
  29. } else {
  30. // Opera >.>
  31. main();
  32. }
  33.  
  34. function addJQuery(callback) {
  35. var script = document.createElement("script");
  36. script.textContent = "(" + callback.toString() + ")();";
  37. document.body.appendChild(script);
  38. }