-
-
Save gaute/1357711 to your computer and use it in GitHub Desktop.
// ==UserScript== | |
// @name Printable GitHub issues | |
// @namespace https://github.com/gaute | |
// @include https://github.com/*/issues/* | |
// ==/UserScript== | |
if (typeof($) === "undefined") { | |
$ = unsafeWindow.$; | |
} | |
function main() { | |
var printcss = '#header, #footer, .instapaper_ignore, .subnav-bar, ' | |
+ '.context-loader, .actions, .error, ' | |
+ '.notification-settings, .ajax-error-message, form, .back, ' | |
+ '.js-comment-container, .avatar .overlay {display: none;}' | |
+ '.new-comments .js-comment-container {display: block;}' | |
+ '.new-comments {margin-left: 60px;}'; | |
var screencss = $('head link[media=screen]').attr('href'); | |
$('head').append('<link rel="stylesheet" media="print" href="' + screencss + '" type="text/css" />'); | |
$('head').append('<style media="print">' + printcss + '</style>'); | |
} | |
var script = document.createElement('script'); | |
script.textContent = '(' + main.toString() + ')();'; | |
document.body.appendChild(script); |
cbilgili
commented
Feb 3, 2012
via email
Ah, in Google Chrome, I just hit the "raw" link above, then Chrome asks to install the script.
If this doesn't work in your browser, try googling for info on userscripts.
I have installed the script. But normal print feature doesn't change, same as old. My chrome is 16.0 and OS is Mac osx lion.
This one only works on issues. I expanded it for commits, pull requests and wikis:
https://gist.github.com/1385148
I use this in Chrome on two OS X computers.
Awesome, thank you very much.
Using Safari 6.0.1 btw.
This is great, but doesn't seem to work with the new Github layout. Any suggestions?
We also just created this for printing Kanban cards, it's an easy to install Gem
Yesterday I was having issues printing a github issue for review on paper. It kept cutting things off!
After some googling, I ended up on this gist (among many other things), to no avail.
In the end, I found that the issue was that I was zoomed into the web page. resetting my zoom to 100% made it so I could print the Issue without... issues. Hope this helps someone else in the future.