您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Gets you to the real image!
当前为
// ==UserScript== // @name 500px.com Userscript Experiment // @namespace github.com/hrxn // @description Gets you to the real image! // @version 0.2 // @author Hrxn <github.com/hrxn> // @license Creative Commons BY-NC-SA // @include http*://500px.com/* // @grant none // @icon https://assetcdn.500px.org/assets/favicon-1e8257b93fb787f8ceb66b5522ee853c.ico // ==/UserScript== (function () { var path = window.location.pathname.split("/"); var name = path[3]; var addElements = function (src) { var el = document.querySelector('.main_container .sidebar_region .photo_sidebar .actions_region'); el.insertAdjacentHTML('afterEnd', '<a href="' + src + '" target="_blank"> [ View... ] </a> | <a href="' + src + '" download="' + name + '"> [ Download... ] </a>'); } var eventHandler = function (events) { events.forEach(function (event) { if (event.type == "attributes" && event.attributeName == 'src') { if (event.target.src.indexOf('/h%3D300/') == - 1 && event.target.alt != "" && event.target.className == "photo") { addElements(event.target.src); // < Console debug output : // statements go here, e.g. : // console.log(event.target, event.target.src); // console.log(window.location.pathname.split("/")); // console.log(name); // Console debug output > } } }); } var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; var target = document.querySelector('body'); var observer = new MutationObserver(eventHandler); var config = { attributes : true, subtree : true } observer.observe(target, config); })();