// ==UserScript== // @name 知乎获取大图链接 // @description 知乎批量获取原始图片的地址链接 // @namespace huching.net // @include https://www.zhihu.com/question/ // @match *://www.zhihu.com/* // @version 0.1 // @license MIT License // @supportURL huching.net // @grant none // @downloadURL none // ==/UserScript== var head = document.getElementsByTagName('head'); head[0].insertAdjacentHTML('beforeend', ''); document.body.insertAdjacentHTML('beforeend', ''); var bottom = document.getElementById('button'); bottom.onclick = function () { document.body.setAttribute('style', 'overflow: hidden'); document.body.insertAdjacentHTML('beforeend', '
全选复制下载链接
'); var url = document.getElementById('urltext'); var img = document.images; for (i = 0; i < img.length; i++) { if (typeof img[i].dataset.original === 'string') { url.innerHTML += img[i].dataset.original + '\r' } } url.onclick = function () { url.select(); } var close = document.getElementById('close'); close.onclick = function () { document.body.setAttribute('style', ''); var shadow = document.getElementById('shadow'); shadow.parentNode.removeChild(shadow); } }