V2EX助手

V2EX助手,将v2ex.com的帖子超链接改为新窗口打开

当前为 2016-09-04 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name V2EX助手
  3. // @namespace http://zhihaofans.com
  4. // @version 0.2
  5. // @description V2EX助手,将v2ex.com的帖子超链接改为新窗口打开
  6. // @author zhihaofans
  7. // @match http://www.v2ex.com/go/*
  8. // @match http://www.v2ex.com/?tab=*
  9. // @match http://www.v2ex.com
  10. // @grant none
  11. // @note V0.1:初始版本
  12. // @note V0.2:更新了图标
  13. // @icon http://www.v2ex.com/static/img/icon_rayps_64.png
  14. // ==/UserScript==
  15. $(document).ready(function(){
  16. var v2ex_js_links=$("span.item_title a");
  17. var v2ex_js_links_num=v2ex_js_links.length;
  18. console.log(v2ex_js_links_num);
  19. for(var v2ex_js_a=0;v2ex_js_a<v2ex_js_links_num;v2ex_js_a++)
  20. {
  21. var v2ex_js_link=$("span.item_title a:eq("+v2ex_js_a+")");
  22. v2ex_js_link.attr("target","_blank");
  23. }
  24. });