gf.qytechs.cn "Show Favorites" Redirect

Automatic redirect for gf.qytechs.cn favorite scripts on user's profile page

  1. /******************************************************************************
  2. * gf.qytechs.cn scripts "Show Favorites" Redirect by Jan Karjalainen
  3. * Based on the Linux.org news "Read full article" redirect by Jaap Haitsma (jaap at haitsma dot org) see: http://userscripts.org/scripts/show/5350
  4. *
  5. * version 0.1
  6. * 2015-11-07
  7. * Copyright (c) 2015, Jan Karjalainen
  8. * Released under the GPL license, version 4
  9. * http://www.gnu.org/copyleft/gpl.html
  10. ******************************************************************************
  11. * On load of gf.qytechs.cn user profile page, if there is a link to favorite script set whose inner html is 'View scripts' then:
  12. * - redirect to reffered link in the actual window is done
  13. *
  14. * This script asumes linux today stories contains the text "View scripts"
  15. * in the link to the article.
  16. *
  17. *
  18. * To Install:
  19. * - like any greasemonkey script: install greasemonkey, restart FF, open
  20. * this script in a browser window, go to Tools/Install User Script
  21. *
  22. * To Uninstall:
  23. * - like any greasemonkey script: Tools/Manage User Scripts, select
  24. * 'greasyfork-showfavorites "Show Favorites" Redirect', click the Uninstall button
  25. *
  26. * Changelog:
  27. * ver 0.1
  28. * 2015-11-07
  29. * Jan Karjalainen
  30. * - 1st ver
  31. */
  32.  
  33. // ==UserScript==
  34. // @name gf.qytechs.cn "Show Favorites" Redirect
  35. // @description Automatic redirect for gf.qytechs.cn favorite scripts on user's profile page
  36. // @namespace http://userscript.org/
  37. // @include https://gf.qytechs.cn/*/users/*
  38. // @include http://gf.qytechs.cn/*/users/*
  39. // @grant none
  40. // @version 0.1
  41. // ==/UserScript==
  42.  
  43. (function() {
  44. try {
  45. textLink="View scripts";
  46. nPage=-1;
  47. // opens 1.st such a link in tab
  48. for( i=0; i < document.links.length; i++ )
  49. if( document.links[ i ].innerHTML.match( textLink ))
  50. window.location.href=document.links[i].href
  51. }
  52. catch (e) {
  53. GM_log( 'gf.qytechs.cn "Show Favorites" Redirect - script exception: ' + e );
  54. alert ( 'gf.qytechs.cn "Show Favorites" Redirect - script exception: ' + e );
  55. }
  56. }
  57. )();

QingJ © 2025

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