Posted By

Pyro979 on 09/03/10


Tagged

greasemonkey


Versions (?)

Suggestion for HelvetireaderĀ² (with 100% less reloading)


 / Published in: JavaScript
 

  1. // ==UserScript==
  2. // @name Helvetireader 2
  3. // @description Helvetireader style for Google Reader that also removes a lot of features so you probably won't like it!
  4. // @include https://*.google.com/reader/view/*
  5. // @include http://*.google.com/reader/view/*
  6. // @include htt*://*.google.*/reader/view*
  7. // @author Helvetireader by Jon Hicks (http://www.hicksdesign.co.uk) with favicon override by MkFly
  8. // ==/UserScript==
  9.  
  10.  
  11. var favvy = document.createElement('link');
  12. favvy.setAttribute('type', 'image/x-icon');
  13. favvy.setAttribute('rel', 'shortcut icon');
  14. favvy.setAttribute('href', 'http://www.helvetireader.com/favicon.png');
  15. var head = document.getElementsByTagName('head')[0];
  16. head.appendChild(favvy);
  17.  
  18. var cssNode = document.createElement('link');
  19. cssNode.type = 'text/css';
  20. cssNode.rel = 'stylesheet';
  21. cssNode.href = 'http://www.helvetireader.com/css/helvetireader.2.css';
  22. cssNode.media = 'screen';
  23. cssNode.title = 'dynamicLoadedSheet';
  24. document.getElementsByTagName("head")[0].appendChild(cssNode);
  25.  
  26. //Bottom Looks Funny Fix
  27. setTimeout(runOnLoadSetup,3000);
  28. function runOnLoadSetup()
  29. {
  30. var minimizeControl = document.getElementById("lhn-subscriptions-minimize");//get minimize control
  31. simulateClick(minimizeControl);//click minimize
  32. simulateClick(minimizeControl);//click maximize, and now it should repaint
  33. }
  34.  
  35. function simulateClick(el)
  36. {
  37. var evt = document.createEvent("MouseEvents");
  38. evt.initMouseEvent("click", true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null);
  39.  
  40. el.dispatchEvent(evt);
  41. }

Report this snippet  

You need to login to post a comment.