Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created February 22, 2009 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hitode909/68373 to your computer and use it in GitHub Desktop.
Save hitode909/68373 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name coconutsfine
// @namespace http://d.hatena.ne.jp/coconutsfine/
// @description visit my page!!!
// @include *
// ==/UserScript==
var mypage = 'http://d.hatena.ne.jp/coconutsfine/'
if(window.location.href.match(mypage) ){
alert("俺のページにようこそ!!");
}else{
alert("俺のページに来てください!!");
window.location.href = mypage
}
// うまくいかなかった
// var visit = function(mypage){
// window.location.href = mypage
// }
// if(window.location.href.match(mypage) ){
// alert("俺のページにようこそ!!");
// }else{
// if(confirm("俺のページに来てください!!")){
// visit(mypage);
// }
// }
// GM_registerMenuCommand('Visit now!!', visit(mypage));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment