Advertisement
Guest User

KotakAU Trending Articles removal v0.2

a guest
Aug 5th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Kotaku Trending Articles Remover
  3. // @namespace http://your.homepage/
  4. // @version 0.2
  5. // @description Remove trending articles pane when it gets loaded
  6. // @author os42
  7. // @include https://www.kotaku.com.au/20*
  8. // @include http://www.kotaku.com.au/20*
  9. // @include https://www.gizmodo.com.au/20*
  10. // @include http://www.gizmodo.com.au/20*
  11. // @include https://www.lifehacker.com.au/20*
  12. // @include http://www.lifehacker.com.au/20*
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. $(function() {
  17. var target = document.querySelector('#article_post');
  18.  
  19. var observer = new MutationObserver(function(mutations) {
  20. mutations.forEach(function(mutation) {
  21. if (mutation.type === "childList" && mutation.previousSibling.id === "loading_trending_posts_icon") {
  22. $(mutation.addedNodes).each(function(i, node) {
  23. //if (node.id === "trending-river") {
  24. node.remove();
  25. //}
  26. });
  27. observer.disconnect();
  28. }
  29. });
  30. });
  31.  
  32. // configuration of the observer:
  33. var config = { attributes: true, childList: true, characterData: true }
  34.  
  35. // pass in the target node, as well as the observer options
  36. observer.observe(target, config);
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement