您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
try to take over the world!
当前为
// ==UserScript== // @name 500px 图片下载 // @namespace http://akoala.me/ // @version 0.1 // @description try to take over the world! // @author akoala.me // @match https://*.500px.com/photo/* // @match https://500px.com/photo/* // @grant none // @require https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js // @require https://cdn.bootcss.com/FileSaver.js/2014-11-29/FileSaver.min.js // ==/UserScript== (function() { 'use strict'; // Your code here... setTimeout(function () { var img = ".photo-show__img" addBtn(); $("body").on("click", "#dl1", ()=>{ window.open( $(img).attr("src")) }) $("body").on("click", "#dl", ()=>{ var url = $(img).attr("src") getImageBlob(url, (blob)=>{ saveAs(blob, new Date() + ".png"); }) }) // 添加导出按钮 function addBtn() { $(img).before(`<div style="display:inline;"><button id="dl">尝试保存</button><button id="dl1">新窗打开</button></div>`) } //获取图片的Blob值 function getImageBlob(url, cb) { var xhr = new XMLHttpRequest(); xhr.open("get", url, true); xhr.responseType = "blob"; xhr.onload = function() { if (this.status == 200) { if(cb) cb(this.response); } }; xhr.send(); } }, 5000) })();