title: Greasemonkey script to turn off annoying things
body: <p>Is there a way I can use Greasemonkey to selectively remove scripts on a site?</p>
  
  <p>Disclaimer: I know JS but don't have much (read: none) direct experience with GM. </p>
  
  <p>I just need to stop external scripts from loading (can't use NoScript because I want to load other less annoying scripts).</p>
  
  <p>I tried doing this:</p>
  
  <pre><code>// ==UserScript==
  // @name           turn_shit_off
  // @namespace      http://www.google.com
  // @include        http://www.xyz.com/*
  // ==/UserScript==
  
  window.onload = function() {
      var d = document;   // shorthand
      var scripts = d.getElementsByTagName('script');
      for(var i = 0; i &lt; scripts.count; i++) {
          if(scripts[i].src.indexOf('foobar.js') != -1) {
              scripts[i].src = '';
          }
      }
  }
  </code></pre>
  
  <p>But it doesn't work for me.</p>