kemono.user.js を更新

このコミットが含まれているのは:
skscript 2023-10-28 12:39:35 +09:00
コミット 86cf47c5e8
1個のファイルの変更28行の追加0行の削除

ファイルの表示

@ -116,6 +116,31 @@
}
}
class KemonoUrl {
static check(href) {
return !!href.match(/https:\/\/kemono.{su,party}/i);
}
constructor(href) {
this.href = href;
}
extract_user_id() {
const re = /https:\/\/kemono.{su,party}\/(?<platform>\w)\/user\/(?<userid>\d+)/i;
const match = href.match(re);
if(match) {
return {ok: {userid: match.groups.userid, platform: match.groups.platform}};
}
else {
return {err: '?'};
}
}
generate_kemono_url(user_id) {
return 'https://kemono.su/' + user_id.platform + '/user/' + user_id.userid;
}
}
const href = location.href;
let url;
@ -131,6 +156,9 @@
else if(PatreonUrl.check(href)) {
url = new PatreonUrl(href);
}
else if(KemonoUrl.check(href)) {
url = new KemonoUrl(href);
}
else {
url = undefined;
}