DeviantArt More From Hider

For those that open far more tabs than your browser can handle (stupid x86 memory limits), this script hides the "More From" sidebar elements but adds button that toggles them on and off

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name        DeviantArt More From Hider
// @description For those that open far more tabs than your browser can handle (stupid x86 memory limits), this script hides the "More From" sidebar elements but adds button that toggles them on and off
// @namespace   arof
// @include     *//*.deviantart.com/art/*
// @version     1
// @grant       none
// ==/UserScript==

function inject(func)
{
	var script = document.createElement("script");
	script.setAttribute("type", "application/javascript");
	script.appendChild(document.createTextNode(func));
	document.body.appendChild(script);
}

function hideAll()
{
	var array = document.getElementsByClassName("deviation-mlt-preview deviation-mlt-preview-b");
	for(var key in array)
	{
		var elem = array[key];
		elem.setAttribute("hidden", "true");
	}
}

function expandAll()
{
	var array = document.getElementsByClassName("deviation-mlt-preview deviation-mlt-preview-b");
	for(var key in array)
	{
		var elem = array[key];
		if (elem.hasAttribute("hidden"))
			elem.removeAttribute("hidden");
		else
			elem.setAttribute("hidden", "true");
	}
}

function insertButton()
{
	var metaActions = document.getElementsByClassName("dev-meta-actions")[0];
	inject(expandAll);

	var button = document.createElement("input");
	button.type = "button";
	button.value = 'Show "More Froms"';
	button.setAttribute("onclick", "expandAll()");

	metaActions.insertBefore(button, metaActions.firstChild);
}

insertButton();
hideAll();