Greasy Fork is available in English.
Bind a hotkey to show a Tumblr user's likes page (alt+L)
当前为
// ==UserScript==
// @name Tumblr likes hotkey
// @version 1.0.0
// @description Bind a hotkey to show a Tumblr user's likes page (alt+L)
// @author salad: http://greasyfork.icu/en/users/241444-salad
// @include https://www.tumblr.com/dashboard/blog/*
// @include https://*.tumblr.com*
// @include http://*.tumblr.com*
// @namespace http://greasyfork.icu/users/241444
// ==/UserScript==
(function() {
const showLikes = () => {
const m = (pattern) => window.location.href.match(pattern);
const urlMatch = m(/^https:\/\/www.tumblr.com\/dashboard\/blog\/([^\/]+)/) || m(/^https?:\/\/([^\.]+)\.tumblr.com/);
console.log(urlMatch);
urlMatch && (window.location.href='https://www.tumblr.com/liked/by/'+urlMatch[1]);
};
document.addEventListener("keypress", function onPress(ev) {
if (ev.key === "l" && ev.altKey) {
showLikes();
}
});
})();