Tumblr likes hotkey

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: https://gf.qytechs.cn/en/users/241444-salad
// @include      https://www.tumblr.com/dashboard/blog/*
// @include      https://*.tumblr.com*
// @include      http://*.tumblr.com*
// @namespace https://gf.qytechs.cn/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();
      }
  });

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址