Skip to content

Commit

Permalink
Tumblrフォーム変更対応(暫定応急パッチ)
Browse files Browse the repository at this point in the history
  • Loading branch information
to committed Jan 28, 2013
1 parent c2b28bb commit c6b3967
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions xpi/chrome/content/library/20_Tumblr.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,3 +589,24 @@ Tumblr.Quote = {
}

models.register(Tumblr);


/*
* Tumblrフォーム変更対応パッチ(2012/1/25周辺)
* UAを古いAndroidにして旧フォームを取得。
*
* polygonplanetのコードを簡略化(パフォーマンス悪化の懸念あり)
* https://gist.github.com/4643063
*/
var request_ = request;
request = function(url, opts){
if(/^https?:\/\/(?:\w+\.)*tumblr\..*\/(?:reblog\/|new\/\w+)/.test(url)){
opts = updatetree(opts, {
headers : {
'User-Agent' : 'Mozilla/5.0 (Linux; U; Android 2.3.4; ja-jp; Build) Version/4.0 Mobile Safari/532'
}
});
}

return request_(url, opts);
};

0 comments on commit c6b3967

Please sign in to comment.