Greasy Fork

Greasy Fork is available in English.

Pixiv illustration full size link converter

Displaying and linking to the original picture on the thumbnail container, instead of a container page. Especially a goodie for people who were benefitted with similar function provided by Pixiv++.

目前为 2014-12-11 提交的版本,查看 最新版本

// ==UserScript==
// @namespace   com.whoopsworkshop.hkgsherlock.userjs.pixiv_illust_full
// @id          com.whoopsworkshop.hkgsherlock.userjs.pixiv_illust_full
// @icon        data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAAA3NCSVQICAjb4U/gAAAAYnpUWHRSYXcgcHJvZmlsZSB0eXBlIEFQUDEAAHicVcixDYAwDADB3lN4hHccHDIOQgFFQoCyf0EBDVee7O1so696j2vrRxNVVVXPkmuuaQFmXgZuGAkoXy38TEQNDyseBiAPSLYUyXpQ8HMAAAUhSURBVFiF7ZltbBRFHMafmd29Xq9vh32lFNsCpYS38CZqFYtBG1FD0Eg0qBGNQQJBEZSgX/xmbUJCCKJGQxASEzQBCyRFECKQkFSFtOUKpWdbELgXoC29tne9u92d8cOVsne97W4LS/zAk/tyz8zO/G7mPzP/nSP46iiSSQSKbQJLWnZvUjiuyapeqaj7GNAe1X3MOtEH3+XIeghkpIdARtJdZcnFAcbBOHjsoykiBBSgBJSCWA3EOFQGhUEU3i4dN2981uTstNwMe6ZdEgXKOQ9GlM7+yJXu4Flvzw9tXZBVSAKEsZARvY1xUApDRFlUmLl6blFlWf7ER9LMNNp+s7f2vOeT+n/BOSRhVFg6QByQVTBeU1HyzuOl+ZmpCeVd/WFfYKA7FGWMO2xCXkZqSU768GZ+Pnvljd9aQAhEs8GaDEhWwbFrSdl7FVO0dlhWjzR7Drb497R1QuWg5O5PZxyMvzY5e9W8iS/NKor7aRwf7j/3tcsPhzR6IMYRkqsXlW5+fjoldwfaHxj48njLjibvYGQIOnPAOGQVIq1bNmvpzAnakoONV5cfOI8022iAIspj2Y7aNxcWOh3aGtv/uLThxD9wSBDMDTsHBuRV5bm7Vy7U2vUdt57c/SfSDZ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XlIlz9esu/F6SPcV9xf/QdhL+PXM2v0PQAAAABJRU5ErkJggg==
// @name        Pixiv illustration full size link converter
// @description Displaying and linking to the original picture on the thumbnail container, instead of a container page. Especially a goodie for people who were benefitted with similar function provided by Pixiv++.
// @author      hkgsherlock
// @version     201412111844
// @include	/^https?:\/\/www\.pixiv\.net\/member_illust\.php?.*mode=medium.*$/
// @license     Public Domain for source code only.
// ==/UserScript==

// not AJAX anymore lah

// YOU SEE ME TROLLIN', THEY HATIN'
//
// Well, just let users choose what they want. They're still your users even you're not creating a dynasty which controls how they behave. 
// And you're not even the Facebook.

// store references using
var wksDisp = document.querySelector('div.works_display');
var thumb = wksDisp.querySelector('._illust_modal._layout-thumbnail');
var big = thumb.querySelector('.big');
var medium = thumb.querySelector('.medium');

// get the size of medium
var mW = medium.width;
var mH = medium.height;

// get the src(href) of the big (~full)
var bSrc = big.src;
if (bSrc.length == 0) bSrc = big.attributes['data-src'].value;

// creating new img for us
var full = medium.cloneNode();
full.classList.remove('medium');
full.classList.add('fullsize');
full.src = bSrc;
full.width = mW;
full.height = mH;

// creating back the link
var link = document.createElement('a');
link.href = bSrc;
link.target = '_blank'
link.appendChild(full);
link.classList.add('_layout-thumbnail');

// creating new thumb as it's extremely hard to remove ev inside original thumb div
// var newThumb = document.createElement('div');
// newThumb.classList.add('_illust_modal');		/// no no no no no adding it will add ev by pixiv's script
// newThumb.classList.add('_layout-thumbnail');
// newThumb.appendChild(link);

// replace
thumb.remove();
wksDisp.appendChild(link);