Skip to content

Instantly share code, notes, and snippets.

@cherenkov
Created October 24, 2008 16:10
Show Gist options
  • Save cherenkov/19470 to your computer and use it in GitHub Desktop.
Save cherenkov/19470 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name hatena_diary_confirm
// @namespace http://d.hatena.ne.jp/Cherenkov/
// @include http://d.hatena.ne.jp/*/edit*
// @include http://d.hatena.ne.jp/*/draft?epoch=*
// ==/UserScript==
var link = document.evaluate("//a[not(@target='_blank')]", document, null, 7, null);
for(var i=0;i<link.snapshotLength;i++){
link.snapshotItem(i).setAttribute("onclick","if( !confirm('ページ遷移しますがよろしいですか') ) { return false; }");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment