// ==UserScript== // @name 微博图片原图地址批量复制 // @description 点击一条微博下方的“复制”链接后,就可粘贴到贴吧或者迅雷批量下载 // @include http://www.weibo.com/* // @version 0.9 // @author yechenyin // @namespace https://greasyfork.org/users/3586-yechenyin // @require https://code.jquery.com/jquery-1.11.2.min.js // @grant GM_setClipboard // @downloadURL none // ==/UserScript== jQuery.fn.loaded = function (action) { var target = this; if ($(this.selector).length > 0) setTimeout(function() {action();}, 300); else setTimeout(function() {target.loaded(action);}, 100); }; if (!location.href.indexOf("http://www.weibo.com/")) { block = "unlock"; add_copy_links(); $(document).on('DOMNodeInserted', '#plc_main', add_copy_links); } function add_copy_links() { if (block != 'lock') { block = 'lock'; $('.WB_row_line li').loaded(function () { console.log($('.WB_row_line').length); for (var i=0; i<$('.WB_row_line').length; i++) { if ($('.WB_row_line').eq(i).find('.copy_images').length === 0) { html = $('.WB_row_line').eq(i).html().substr(0, $('.WB_row_line').eq(i).html().indexOf('')); html += '