Pixiv Replace With Original

Replace Pixiv image with original image

Nainstalovat skript?
Skript doporučený autorem

Mohlo by se vám také líbit i.pximg.net 403 Forbidden Fix.

Nainstalovat skript

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Pixiv Replace With Original
// @name:zh-TW   Pixiv 替換為高畫質原圖
// @name:zh-CN   Pixiv 替换为高画质原图
// @namespace    https://blog.maple3142.net/
// @version      0.4
// @description  Replace Pixiv image with original image
// @description:zh-TW  替換 Pixiv 的圖片為高畫質原圖
// @description:zh-CN  替换 Pixiv 的图片为高画质原图
// @author       maple3142
// @match        https://www.pixiv.net/member_illust.php?mode=medium&illust_id=*
// @match        https://www.pixiv.net/member_illust.php?illust_id=*&mode=medium
// @compatible   firefox >=52
// @compatible   chrome >=55
// ==/UserScript==

;(function() {
	'use strict'
	const $ = s => document.querySelector(s)
	const $$ = s => [...document.querySelectorAll(s)]
	function onDomChange(cb) {
		new MutationObserver(() => setTimeout(cb, 50)).observe(document.body, { childList: true })
	}
	function replaceImage() {
		const els = $$('div[role=presentation]>a')
		for (const a of els) {
			const image = a.querySelector('img')
			image.src = a.href
			image.srcset = ''
		}
	}
	onDomChange(replaceImage)
})()