<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4799853221763685782</atom:id><lastBuildDate>Sun, 31 Jul 2011 06:17:52 +0000</lastBuildDate><category>Code</category><category>Firefox</category><category>Javascript</category><category>Printliminator</category><title>Nerdosity</title><description /><link>http://nerdosity.blogspot.com/</link><managingEditor>noreply@blogger.com (Juan)</managingEditor><generator>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Nerdosity" /><feedburner:info uri="nerdosity" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4799853221763685782.post-5715985436766085677</guid><pubDate>Wed, 04 Nov 2009 02:23:00 +0000</pubDate><atom:updated>2009-11-04T00:25:42.946-03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Javascript</category><category domain="http://www.blogger.com/atom/ns#">Printliminator</category><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">Firefox</category><title>Printliminator button on Firefox</title><description>&lt;a href="http://css-tricks.com/examples/ThePrintliminator/"&gt;Printliminator&lt;/a&gt; is a handy little tool when it comes to printing websites. Basically, you keep a bookmark that when clicked allows you to remove content from a website, leaving behind only the parts that matter to you and your printer.&lt;br /&gt;Not that I knew any of this, mind you, at least not until my friend &lt;a href="http://twitter.com/astharis"&gt;Astharis&lt;/a&gt; told me about it and mentioned how it would be cool if she could have a button instead of a bookmark in her browser.&lt;br /&gt;&lt;br /&gt;I figured it wouldn't be too hard to do using Firefox extensions, and I managed to do it using &lt;a href="http://custombuttons2.com/"&gt;Custom Buttons&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt; which, as the the name implies, allows you to create custom buttons for your Firefox.&lt;br /&gt;&lt;br /&gt;The process is not entirely straightforward though, so I figured I'd include a little guide here for anyone who runs into a similar situation.&lt;br /&gt;&lt;br /&gt;Step 1) Download and install &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/5066"&gt;Custom Buttons&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt; - &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/5066"&gt;https://addons.mozilla.org/en-US/firefox/addon/5066&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_z9OHQedfujI/SvDrINCheJI/AAAAAAAAAYc/N81uOg1nHzg/s1600-h/sshot-1.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 320px; height: 98px;" src="http://4.bp.blogspot.com/_z9OHQedfujI/SvDrINCheJI/AAAAAAAAAYc/N81uOg1nHzg/s320/sshot-1.png" alt="" id="BLOGGER_PHOTO_ID_5400074479388948626" border="0" /&gt;&lt;/a&gt;Step 2) Right click the menu bar, you should see a new option (Add New Button) in the context menu.&lt;br /&gt;&lt;br /&gt;Step 3) After clicking this option you'll see a new box pop up. From the three tabs that appear in it (Code, Initialization Code and Help), we'll only work with the init code, so pick that one.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;/*Initialization code*/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;this.leftclick = function(evt)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;let link = "javascript:(function(){function%20loadScript(a,b){var%20c=document.createElement('script');c.type='text/javascript';c.src=a;var%20d=document.getElementsByTagName('head')[0],done=false;c.onload=c.onreadystatechange=function(){if(!done&amp;amp;&amp;amp;(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;b()}};d.appendChild(c)}loadScript('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2',function(){loadScript('http://css-tricks.com/examples/ThePrintliminator/js/printliminator.js',function(){printlimator()})})})()";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;gBrowser.loadURI(link);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;this.setAttribute( 'onclick', 'custombuttons.gQuot.mHandler( event, this )' );&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_z9OHQedfujI/SvDtBDrS3DI/AAAAAAAAAYk/bVDBBAPkiA0/s1600-h/sshot-3.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 206px;" src="http://1.bp.blogspot.com/_z9OHQedfujI/SvDtBDrS3DI/AAAAAAAAAYk/bVDBBAPkiA0/s400/sshot-3.png" alt="" id="BLOGGER_PHOTO_ID_5400076555639774258" border="0" /&gt;&lt;/a&gt;Copy all this code into the box, set a name for the button and add a proper icon if you want. (Remember to click "=&gt; base64" if you're not going to keep the icon around in the same path; That will convert the whole image into code that will be stored by the button so you can delete it)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once you're done click "OK", right click the menu bar once more and pick Customize. You'll see your newly created icon in the list, so just drag and drop it on your browser and enjoy some customized printing.&lt;br /&gt;&lt;br /&gt;And for a little bonus, here's the icon I'm currently using, courtesy of &lt;a href="http://twitter.com/astharis"&gt;Astharis&lt;/a&gt;: &lt;img src="http://img.photobucket.com/albums/v499/darkye/Icons/print.png" /&gt;&lt;br /&gt;&lt;br /&gt;Special thanks to the folks of the &lt;a href="http://custombuttons2.com/en/forum"&gt;Custom Buttons&lt;sup&gt;2&lt;/sup&gt; forums&lt;/a&gt;, for all the helpful examples of code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4799853221763685782-5715985436766085677?l=nerdosity.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Nerdosity/~4/UqDN01Esyrk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/Nerdosity/~3/UqDN01Esyrk/printliminator-button-on-firefox.html</link><author>noreply@blogger.com (Juan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_z9OHQedfujI/SvDrINCheJI/AAAAAAAAAYc/N81uOg1nHzg/s72-c/sshot-1.png" height="72" width="72" /><feedburner:origLink>http://nerdosity.blogspot.com/2009/11/printliminator-button-on-firefox.html</feedburner:origLink></item></channel></rss>

