-
-
Save negipo/21255070eb4d299ee287 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tombloo.Service.extractors.register({ | |
name : 'ReBlog - Dashboard', | |
ICON : 'chrome://tombloo/skin/reblog.ico', | |
check : function(ctx){ | |
return (/(tumblr-beta\.com|tumblr\.com)\//).test(ctx.href) && this.getLink(ctx); | |
}, | |
extract : function(ctx){ | |
// タイトルなどを取得するためextractByLinkを使う(reblogリンクを取得しextractByEndpointを使った方が速い) | |
return Tombloo.Service.extractors.ReBlog.extractByLink(ctx, this.getLink(ctx)); | |
}, | |
getLink : function(ctx){ | |
var link = $x('./ancestor-or-self::li[starts-with(normalize-space(@class), "post")]//a[@title="固定リンク"]', ctx.target); | |
return link && link.href; | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment