ゴミ溜め@技術系日常系雑文

主にWeb技術やそのほかつまづいたこととか引っかかって調べたこととかをまとめてます。

はてなダイアリーから引っ越しました。)

tumblrのクッションページから自動的にリダイレクトさせる

書いた。ただしほぼコピペ。

// ==UserScript==
// @name tumblrRedirect
// @namespace ayebee (http://d.hatena.ne.jp/AyeBee_TY/)
// @include http://*.tumblr.com/post/*
// ==/UserScript==

// refarence: http://www.otchy.net/20110607/use-jquery-on-greasemonkey-for-chrome/

(function (d, func) {
// include jquery.
var h = d.getElementsByTagName('head')[0];
var s1 = d.createElement("script");
s1.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js");
s1.addEventListener('load', function() {
var s2 = d.createElement("script");
s2.textContent = "jQuery.noConflict();(" + func.toString() + ")(jQuery);";
h.appendChild(s2);
}, false);
h.appendChild(s1);
// include jquery end.
})(document, function($) {
// main function.
var tgt = $("div#content div.post div.link a.link").attr("href");
location.href = tgt;
// main function end.
});