// ==UserScript== // @name pixiv direct original image link // @namespace pixiv // @version 1.92 // @description On page with thumbnails of all works makes thumbnails link to actual fullsize images // @homepage https://greasyfork.org/ru/scripts/108-pixiv-direct-original-image-link // @match http://www.pixiv.net/member_illust.php*id* // @match http://*.pixiv.net/img* // @run_at document_end // @run-at document-end // @grant none // @downloadURL https://update.greasyfork.icu/scripts/108/pixiv%20direct%20original%20image%20link.user.js // @updateURL https://update.greasyfork.icu/scripts/108/pixiv%20direct%20original%20image%20link.meta.js // ==/UserScript== if(document.location.hostname != "www.pixiv.net") // manga fix { if(document.body.innerHTML.indexOf("This Page is Not Found") == 4 && document.referrer.indexOf("http://www.pixiv.net/member_illust.php?id=") == 0) { var newpage = document.location.href.substr(document.location.href.lastIndexOf("/")+1); newpage = newpage.substring(0, newpage.indexOf('.')); document.location.replace("http://www.pixiv.net/member_illust.php?mode=manga&illust_id=" + newpage); } return false; } else if(document.referrer.indexOf("http://www.pixiv.net/") != 0 && document.querySelector("div.errorArea")) { var newpage = document.location.href.substr(document.location.href.lastIndexOf("=")+1); window.history.pushState(null,null,"http://www.pixiv.net/member_illust.php?mode=medium&illust_id=" + newpage); // referrer spoof document.location.replace("http://www.pixiv.net/member_illust.php?mode=ugoira_view&illust_id=" + newpage); return false; } var allImgs, thisImgDiv, src, txt, elmNewContent, profIMG, mangafix = false; profIMG = document.body.querySelector("img.user-image"); if(!profIMG){return false;} else{profIMG = profIMG.src;} if(profIMG.indexOf("http://source.pixiv.net") == -1) { profIMG = profIMG.substring(0, profIMG.lastIndexOf('/')) + "/"; profIMG = profIMG.replace('profile', 'img'); } else // no avatar, use BG { var fn; var f = document.getElementsByTagName("style"); for(c=0;c