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.

目前为 2016-07-01 提交的版本。查看 最新版本

  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. // @version 1
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var aList = document.body.querySelectorAll("td.ctitle > a");
  12.  
  13. for (var a of aList) {
  14. var link = a.getAttribute("href");
  15. if (link.includes("?")) {
  16. if (! link.toLowerCase().includes("print=1") ) {
  17. a.setAttribute("href", link.concat("&print=1"));
  18. }
  19. } else {
  20. a.setAttribute("href", link.concat("?print=1"));
  21. }
  22. }