Hentai Haven - Anti-Adblock Killer

Circumvents the Anti-Adblock on Hentai Haven.

2016-04-05 일자. 최신 버전을 확인하세요.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name         Hentai Haven - Anti-Adblock Killer
// @version      0.1.2
// @description  Circumvents the Anti-Adblock on Hentai Haven.
// @author       EroKaylaN
// @match        http://hentaihaven.org/*
// @run-at       document-body
// @namespace    https://greasyfork.org/users/12437
// ==/UserScript==
var all;
(function() {
	'use strict';
	var links = [];
	var timeout;
    var observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if(mutation.attributeName === "href") {
				links.push({target: mutation.target, href: mutation.oldValue});
				clearTimeout(timeout);
				timeout = setTimeout(attachLinks, 200);
			}
        });
    });

	if(document.querySelector('body')) observer.observe(document.querySelector('body'), { childList: true, subtree: true, attributes:true, attributeOldValue:true});

	function attachLinks() {
		observer.disconnect();
		links.forEach(function(link) {
			link.target.href = link.href;
		});

		var downloadBtn = document.querySelector('.download_feed_link');

		downloadBtn.appendChild(document.querySelector('.download-panel'));
		document.querySelector('.download_feed_link > span.tooltip-wrapper').remove();

	  // Clone to remove eventlistener preventing default action.
		var clone = document.querySelector('.download_feed_link').cloneNode(true);
		document.querySelector('.entry-content').insertBefore(clone, downloadBtn);
		downloadBtn.remove();

	  // Notify the success of the script
		document.querySelector('.download_feed_link > sup').textContent = 'Anti-adblock killer was successful';
	}
})();