// ==UserScript== // @name Haiku .ne.jp←→.com h←→h1beta change link // @description はてなハイクの日本版と世界版を行ったり来たり、正式版とベータ版を行ったり来たりするリンクを右上の表示内容を選択と入れ替える。 // @include http://h.hatena.ne.jp/* // @include http://h1beta.hatena.ne.jp/* // @include http://h.hatena.com/* // @include http://h1beta.hatena.com/* // ==/UserScript== /* * @title Haiku .ne.jp←→.com h←→h1beta change link * @description はてなハイクの日本版と世界版を行ったり来たり、正式版とベータ版を行ったり来たりするリンクを右上の表示内容を選択と入れ替える。 * @include http://h.hatena.ne.jp/* * @include http://h1beta.hatena.ne.jp/* * @include http://h.hatena.com/* * @include http://h1beta.hatena.com/* * @license MIT License */ (function(){ var h=location.href; var a=location.host; var b; var w; var beta; var world; var t=''; var o=document.getElementsByClassName('localepanel-community')[0]; //alert(o); if (a=='h.hatena.ne.jp'||a=='h.hatena.com') { b=h.replace('h.','h1beta.'); } else if (a=='h1beta.hatena.ne.jp'||a=='h1beta.hatena.com') { b=h.replace('h1beta.','h.'); beta=1; }; if (a=='h.hatena.ne.jp'||a=='h1beta.hatena.ne.jp') { w=h.replace('.ne.jp','.com'); } else if (a=='h.hatena.com'||a=='h1beta.hatena.com') { w=h.replace('.com','.ne.jp'); world=1; }; t+='