Greasy Fork

Greasy Fork is available in English.

Endless deviantart gallery pages

rt

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Endless deviantart gallery pages
// @namespace    https://www.topcl.net/
// @version      0.2
// @description  rt
// @author       vj
// @match        http://*.deviantart.com/gallery/*
// @match        http://*.deviantart.com/favourites/*
// @match        http://*.deviantart.com/prints/*
// @grant        none
// ==/UserScript==

var pg=1;

function loadPage(url)
{
	//debugger;
	pg++;
	console.log("loadPage " + pg + " - " + url);
	
	//load html
	var xhr=new XMLHttpRequest();
	xhr.open("GET",url,true);
	xhr.send(null);

	xhr.onload = function (e) {
		if (xhr.readyState === 4 && xhr.status === 200) {
			//parse html
			var ndoc=document.implementation.createHTMLDocument("");
			ndoc.body.innerHTML=xhr.response;

			//check result
			var rs=ndoc.getElementById("gmi-ResourceStream");
			if(!rs){console.log("Stop: gmi-ResourceStream not found");}
			
			//add to page
			document.getElementById("gmi-ResourceStream").innerHTML+=rs.innerHTML;

			//check next page
			var next=$(ndoc).find(".next>a").attr("href");
			if(!next)
			{
				console.log("Stop: not found .next>a href");
				return;
			}

			//go next page
			loadPage(next);
		}
	};
}


loadPage(document.getElementById("gmi-GPageButton").href);