Greasy Fork is available in English.

Stack Overflow: StackPrinter

Add Printer-Friendly button to question. This script is forked from http://userscripts-mirror.org/scripts/show/77298 and it add supports for HTTPs

Verze ze dne 01. 02. 2017. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name Stack Overflow: StackPrinter
  3. // @namespace http://userscripts.org/users/gangsta75
  4. // @description Add Printer-Friendly button to question. This script is forked from http://userscripts-mirror.org/scripts/show/77298 and it add supports for HTTPs
  5. // @include http*://stackoverflow.com/questions/*
  6. // @include http*://serverfault.com/questions/*
  7. // @include http*://superuser.com/questions/*
  8. // @include http*://stackapps.com/questions/*
  9. // @include http*://meta.stackoverflow.com/questions/*
  10. // @include http*://*.stackexchange.com/questions/*
  11. // @include http*://askubuntu.com/questions/*
  12. // @include http*://answers.onstartups.com/questions/*
  13. // @include http*://meta.mathoverflow.net/questions/*
  14. // @include http*://mathoverflow.net/questions/*
  15. // @version 2.0.1
  16. // @grant none
  17. // ==/UserScript==
  18.  
  19. function with_jquery(f) {
  20. var script = document.createElement("script");
  21. script.type = "text/javascript";
  22. script.textContent = "(" + f.toString() + ")(jQuery)";
  23. document.body.appendChild(script);
  24. }
  25.  
  26. with_jquery(function($) {
  27. var re = new RegExp("^http[s]*://(.*?)\.(com|net|org)");
  28. var group = re.exec(window.location.href);
  29. var service = group[1];
  30. $('#question .vote:first').append('<div id="PrinterFriendly" style="margin-top:8px"><a alt="Printer-Friendly" title="Printer-Friendly" href="javascript:(function(){f=\'http://www.stackprinter.com/export?format=HTML&service='+service+'&question='+$('.vote').find('input[type=hidden]:first').val()+'\';a=function(){if(!window.open(f))location.href=f};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"><img width="33px" height="33px" src="http://www.stackprinter.com/images/printer.gif"</img></a></div>');
  31. });
  32.