Advertisement
lucaswiman

Chrome User script to make reader suck less

Oct 31st, 2011
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          GoogleReaderNotSuckAnymore
  3. // @namespace     google
  4. // @author        Lucas Wiman (based on smholloway's example script)
  5. // @description   Simple userscript to hide the top banner bar in Google Reader
  6. // @include       http://www.google.com/reader*
  7. // @exclude       http://plus.google.com/*
  8. // @version             001
  9. // @require             http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. try{
  13.  
  14.     // a function that loads jQuery and calls a callback function when jQuery has finished loading
  15.     function addJQuery(callback) {
  16.         var script = document.createElement("script");
  17.         script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
  18.         script.addEventListener('load', function() {
  19.             var script = document.createElement("script");
  20.             script.textContent = "(" + callback.toString() + ")();";
  21.             document.body.appendChild(script);
  22.         }, false);
  23.         document.body.appendChild(script);
  24.     }
  25.  
  26.     // load jQuery and execute the main function
  27.     addJQuery(main);
  28.  
  29.     // hide the black banner at the top of Google Reader
  30.     function main() {
  31.         jQuery(document).ready(function($) {
  32.             $('#viewer-header').css({height: '28px'});
  33.             $('#logo-container').hide();
  34.             $('#top-bar').css({height: 'auto'});
  35.             $('#search').css({padding: '0 0 0 0'})
  36.         });
  37.  
  38.         console.log("simple.user.js: Loaded");
  39.     }
  40. } catch(e) {
  41.     console.log(e);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement