E-H Colour Conversion

Gives E-Hentai the Exhentai colour scheme.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           E-H Colour Conversion
// @description    Gives E-Hentai the Exhentai colour scheme.
// @author         Hen Tie
// @homepage       https://hen-tie.tumblr.com/
// @namespace      https://greasyfork.org/en/users/8336
// @include        /https://(.*\.)?e-hentai.org.*/
// @exclude        https://forums.e-hentai.org/*
// @grant          none
// @icon           https://i.imgur.com/pMMVGRx.png
// @version        1.6
// ==/UserScript==

var ehCss = 'https://e-hentai.org/z/0347/g.css';
var exCss = 'https://exhentai.org/z/0347/x.css';

var addStyle = (function() {
	var style = document.createElement("style");
	style.setAttribute('data-jqstyle','ehColourConversion');
	style.appendChild(document.createTextNode("")); // WebKit hack
	document.head.appendChild(style);
	return style.sheet;
})();
function addLink(url, name) {
	var link = document.createElement('link');
	link.type = 'text/css';
	link.rel = 'stylesheet';
	link.href = url;
	if (name !== "undefined") {
		link.setAttribute('data-jqlink', name);
	}
	document.head.appendChild(link);
}
function removeLink(url) {
	if (document.querySelector('link[href="' + url + '"]')) {
		document.querySelectorAll('link[href="' + url + '"]')[0].disabled = true;
	}
}
function inlineStyle(selector, css) {
	if (document.querySelector(selector)) {
		document.querySelector(selector).style.cssText += ';' + css;
	}
}

addLink(exCss, "ehColourConversion");
removeLink(ehCss);

// bounty pages
addStyle.insertRule('.stuffbox #x {background: none; border-color: #000;}');
// events
addStyle.insertRule('#eventpane {background: #4f535b !important; border-color: #000 !important;}');
// E-H MiniMenu script compatibility
addStyle.insertRule('.nav-submenu {background: #34353b !important; border: 2px solid #8d8d8d !important;}');