Skip to content

Instantly share code, notes, and snippets.

@azu
Created July 31, 2009 14:32
Show Gist options
  • Save azu/159245 to your computer and use it in GitHub Desktop.
Save azu/159245 to your computer and use it in GitHub Desktop.
shortcutkeys['CTRL + D'] = {
description : 'LDR hatebu comment',
execute : function(e){
cancel(e);
with(getMostRecentWindow()){
var url = content.window.location;
var regex = /(http:\/\/reader\.livedoor\.com\/reader\/)/i;
if(regex.test(url)){
var item = content.window.wrappedJSObject.get_active_item(true);
var permalink = item.link.replace(/#/, '%23');
hBookmark.CommentViewer.toggle(permalink);
} else {
alert(url);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment