favstar_recent_link

    
      
  • // ==UserScript==
    // @title          favster_recent_link
    // @name           favster_recent_link
    // @description    favstarのユーザーアイコンをクリックしたときにrecentに飛ぶようにします。
    // @namespace      http://www.udp.jp
    // @include        http://favstar.fm/*
    // @license        MIT License
    // ==/UserScript==
    (function() {
        function replace_avatar_link() {
    	var links = document.getElementsByTagName("a");
    	for (var i = 0; i < links.length; ++i) {
    	    if (links[i].href.indexOf('recent') < 0) {
    		if (links[i].className.indexOf('avatar') >= 0) {
    		    links[i].href += '/recent';
    		} else if (links[i].parentNode 
    			   && links[i].parentNode.className.indexOf('mainAvatar') >= 0) 
    		  {
    		      links[i].href += '/recent';
    		  }
    	    }
    	}
        }
        var win = typeof unsafeWindow != "undefined" ? unsafeWindow : window;
        var view_other_avatars_old = win.view_other_avatars;
        if (typeof view_other_avatars_old == "function") {
    	win.view_other_avatars = function(a, b, c) {
    	    view_other_avatars_old(a, b, c);
    	    setTimeout(replace_avatar_link, 1000);
    	};
        }
        replace_avatar_link();
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2011/09/24 08:56:31 - 2011-09-24
  2. 2011/09/16 23:43:19 - 2011-09-16