前往GreasyFork

吧啦吧啦

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         前往GreasyFork
// @namespace    mimiko/greasyfork
// @version      0.0.4
// @description  吧啦吧啦
// @author       Mimiko
// @license      MIT
// @include      *
// @grant        GM.addStyle
// ==/UserScript==
// https://greasyfork.org/zh-CN/scripts/436753-%E5%89%8D%E5%BE%80greasyfork
"use strict";
(() => {
  if (window.top !== window.self) return;
  // function
  const insertHtml = () => {
    const $el = document.createElement("a");
    const href = `https://greasyfork.org/zh-CN/scripts/by-site/${window.location.host
      .split(".")
      .slice(-2)
      .join(".")}?filter_locale=0`;
    const listAttr = [
      ["href", href],
      ["id", "btn-jump-greasyfork"],
      ["rel", "noopener noreferrer"],
      ["target", "_blank"],
    ];
    listAttr.forEach((group) => $el.setAttribute(...group));
    document.body.appendChild($el);
  };
  const insertCss = () => {
    GM.addStyle(`
      #btn-jump-greasyfork {
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 65535;
        width: 32px;
        height: 32px;
        background-color: rgb(153, 0, 0);
        border-radius: 0 32px 0 0;
        cursor: pointer;
        transition: all 0.3s ease;
        opacity: 0;
        transform-origin: left bottom;
        transform: scale(0.5);
      }
      #btn-jump-greasyfork:hover {
        opacity: 1;
        transform: scale(1);
      }
    `);
  };
  const main = () => {
    insertCss();
    insertHtml();
  };
  // execute
  main();
})();