Greasy Fork is available in English.
Add a download button for macapp.so
当前为
// ==UserScript==
// @name Macapp download helper
// @namespace http://nobelliu.github.io/
// @version 0.2
// @description Add a download button for macapp.so
// @author NobelLiu
// @match http://www.macapp.so/*/
// @grant none
// @require https://code.jquery.com/jquery-2.1.4.min.js
// ==/UserScript==
'use strict';
$(setTimeout(function () {
if (document.getElementById("code")) {
var dl = document.getElementsByClassName("download")[0];
var code = document.getElementById("code");
var a = document.createElement('a');
var scode = document.body.innerHTML.match(/document.getElementById\("code"\).innerHTML="\w\w\w\w/).toString().match(/\w\w\w\w$/);
a.innerHTML = scode;
var href = "/go" + window.location.pathname;
a.setAttribute("href", href);
a.setAttribute("target", "_blank");
a.style.cssText = "color:gray;background-color:white;width:40px;height:24px;padding:2px 8px;border:1px solid #ccc;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius:5px;";
dl.insertBefore(a, code);
code.removeAttribute("id")
}
}
, 1000));