GameFAQs - Print Version FAQ links

Adds the string '?print=1' to all of the FAQ links on a game's FAQ page, making them point to the lightweight print version.

  1. // ==UserScript==
  2. // @name GameFAQs - Print Version FAQ links
  3. // @namespace rudicron
  4. // @description Adds the string '?print=1' to all of the FAQ links on a game's FAQ page, making them point to the lightweight print version.
  5. // @include http://www.gamefaqs.com/*/*/faqs
  6. // @include https://www.gamefaqs.com/*/*/faqs
  7. // @include http://gamefaqs.gamespot.com/*/*/faqs
  8. // @include https://gamefaqs.gamespot.com/*/*/faqs
  9. // @version 1.1
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. var aList = document.body.querySelectorAll("td.ctitle > a");
  14.  
  15. for (var a of aList) {
  16. var link = a.getAttribute("href");
  17. if (link.includes("?")) {
  18. if (! link.toLowerCase().includes("print=1") ) {
  19. a.setAttribute("href", link.concat("&print=1"));
  20. }
  21. } else {
  22. a.setAttribute("href", link.concat("?print=1"));
  23. }
  24. }