<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>I've edited your code to make it a lot more compliant with Greasemonkey conventions. (Changed element.type= to element.setAttribute() among other things.)

I've also removed the recursion problem you had. Your script added the style into the head tag every time a page loads, including frames. This caused a massive memory problems as every new page that you viewed added up to 12 new blocks of code depending on how many iframes there were. Only a full page refresh (F5) would release the lines.

The code now only runs on the top most window and only if the style has not been appended to the page.

I have used this script in one of my own Facebook mods (ApacheFB) but it's still in Alpha testing phase atm and still heavily under construction. I've added you in the dedications. If you run with this update, it would be nice if you could do the same. :) 

-={Apache}=-

&lt;pre&gt;// ==UserScript==
// @name          Remove Facebook Ads (Updated By -={Apache}=-)
// @namespace     sizzlemctwizzle
// @description   Uses a small amount of CSS to remove advertisements.
// @require       http://sizzlemctwizzle.com/updater.php?id=46560
// @version       #.#.#
// @include       http://*.facebook.com/*
// ==/UserScript==

window.removeFacebookAds =  function() {
    if (self!=top||!document.getElementsByTagName('head')[0]||document.getElementById(fb_remove_ads_style)) { return; }
    var fb_remove_ads_style = document.createElement('style'); 
        fb_remove_ads_style.setAttribute('type', 'text/css');
        fb_remove_ads_style.setAttribute('id', 'fb_remove_ads_style');
    try { 
        fb_remove_ads_style.innerHTML = '#right_column { width: 77% !important; } .ad_capsule, #sidebar_ads, .adcolumn, .emu_sponsor, div[id^=&quot;emu_&quot;], .social_ad, .sponsor, .footer_ad,  #home_sponsor, .house_sponsor, #home_sponsor_nile, .PYMK_Reqs_Sidebar, .LSplitView_RightInner { display: none !important; } #wallpage { width: 700px !important; } .LSplitView_ContentWithNoLeftColumn { width: 100% !important }';
    }
    catch(x) { 
        fb_remove_ads_style.innerText = '#right_column { width: 77% !important; } .ad_capsule, #sidebar_ads, .adcolumn, .emu_sponsor, div[id^=&quot;emu_&quot;], .social_ad, .sponsor, .footer_ad,  #home_sponsor, .house_sponsor, #home_sponsor_nile, .PYMK_Reqs_Sidebar, .LSplitView_RightInner { display: none !important; } #wallpage { width: 700px !important; } .LSplitView_ContentWithNoLeftColumn { width: 100% !important }';
    }
    document.getElementsByTagName('head')[0].appendChild(fb_remove_ads_style);
}
window.addEventListener(&quot;load&quot;, removeFacebookAds, false);&lt;/pre&gt;</body>
  <body-html>&lt;p&gt;I've edited your code to make it a lot more compliant with Greasemonkey conventions. (Changed element.type= to element.setAttribute() among other things.)&lt;/p&gt;

&lt;p&gt;I've also removed the recursion problem you had. Your script added the style into the head tag every time a page loads, including frames. This caused a massive memory problems as every new page that you viewed added up to 12 new blocks of code depending on how many iframes there were. Only a full page refresh (F5) would release the lines.&lt;/p&gt;

&lt;p&gt;The code now only runs on the top most window and only if the style has not been appended to the page.&lt;/p&gt;

&lt;p&gt;I have used this script in one of my own Facebook mods (ApacheFB) but it's still in Alpha testing phase atm and still heavily under construction. I've added you in the dedications. If you run with this update, it would be nice if you could do the same. :) &lt;/p&gt;

&lt;p&gt;-={Apache}=-&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;// ==UserScript==
// @name          Remove Facebook Ads (Updated By -={Apache}=-)
// @namespace     sizzlemctwizzle
// @description   Uses a small amount of CSS to remove advertisements.
// @require       http://sizzlemctwizzle.com/updater.php?id=46560
// @version       #.#.#
// @include       http://*.facebook.com/*
// ==/UserScript==

window.removeFacebookAds =  function() {
    if (self!=top||!document.getElementsByTagName('head')[0]||document.getElementById(fb_remove_ads_style)) { return; }
    var fb_remove_ads_style = document.createElement('style'); 
        fb_remove_ads_style.setAttribute('type', 'text/css');
        fb_remove_ads_style.setAttribute('id', 'fb_remove_ads_style');
    try { 
        fb_remove_ads_style.innerHTML = '#right_column { width: 77% !important; } .ad_capsule, #sidebar_ads, .adcolumn, .emu_sponsor, div[id^=&quot;emu_&quot;], .social_ad, .sponsor, .footer_ad,  #home_sponsor, .house_sponsor, #home_sponsor_nile, .PYMK_Reqs_Sidebar, .LSplitView_RightInner { display: none !important; } #wallpage { width: 700px !important; } .LSplitView_ContentWithNoLeftColumn { width: 100% !important }';
    }
    catch(x) { 
        fb_remove_ads_style.innerText = '#right_column { width: 77% !important; } .ad_capsule, #sidebar_ads, .adcolumn, .emu_sponsor, div[id^=&quot;emu_&quot;], .social_ad, .sponsor, .footer_ad,  #home_sponsor, .house_sponsor, #home_sponsor_nile, .PYMK_Reqs_Sidebar, .LSplitView_RightInner { display: none !important; } #wallpage { width: 700px !important; } .LSplitView_ContentWithNoLeftColumn { width: 100% !important }';
    }
    document.getElementsByTagName('head')[0].appendChild(fb_remove_ads_style);
}
window.addEventListener(&quot;load&quot;, removeFacebookAds, false);&lt;/pre&gt;&lt;/p&gt;</body-html>
  <created-at type="datetime">2009-10-07T01:07:24Z</created-at>
  <forumable-id type="integer">46560</forumable-id>
  <forumable-type>Script</forumable-type>
  <id type="integer">176655</id>
  <topic-id type="integer">36717</topic-id>
  <updated-at type="datetime">2009-10-08T11:22:08Z</updated-at>
  <user-agent>Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) FirePHP/0.3</user-agent>
  <user-id type="integer">111474</user-id>
</post>
