Tom's Hardware Print View

Displays Tom's Hardware articles in print view.

  1. // ==UserScript==
  2. // @name Tom's Hardware Print View
  3. // @namespace http://elvencraft.com/greasemonkey
  4. // @description Displays Tom's Hardware articles in print view.
  5. // @match *://*.tomshardware.com/*
  6. // @run-at document-start
  7. // @version 2017.11.16
  8. // Tested using Firefox, Chrome
  9. // ==/UserScript==
  10.  
  11. (function ()
  12. {
  13. function changeLinks()
  14. {
  15. if (!location.href.match('/print/')) {
  16. var links = document.evaluate("//a[contains(@href, '/reviews/')]",
  17. document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  18. for (var index = 0; index < links.snapshotLength; index++)
  19. links.snapshotItem(index).href = links.snapshotItem(index).href
  20. .replace('/reviews/', '/print/') .replace(',', ',reviews-');
  21. }
  22. }
  23. unsafeWindow.print = function () {}; // disable window.print();
  24. document.addEventListener("DOMContentLoaded", changeLinks);
  25. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址