test

generic test script

目前为 2014-09-18 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @author /u/noeatnosleep
  3. // @name test
  4. // @version 1.2
  5. // @namespace generictest
  6. // @description generic test script
  7. // @include http://*reddit.com/*
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
  9. // ==/UserScript==
  10.  
  11. document.addEventListener("DOMContentLoaded", replaceLinks, false );
  12.  
  13. if( document.readyState === "complete" ) {
  14. replaceLinks();
  15. }
  16.  
  17. function replaceLinks() {
  18. Array.forEach( document.links, function(a) {
  19. a.href = a.href.replace( "/mod", "mod/about/unmoderated/" );
  20. });
  21. }