Remove PackageTrackr.com Ad-Block Modal

PackageTrackr recently added an ad-block detection popup. Script removes it as soon as it's added.

当前为 2023-04-26 提交的版本,查看 最新版本

// ==UserScript==
// @name         Remove PackageTrackr.com Ad-Block Modal
// @namespace    http://tampermonkey.net/
// @version      0.12
// @description  PackageTrackr recently added an ad-block detection popup.  Script removes it as soon as it's added.
// @author       Will Belden
// @license      MIT
// @include      https://www.packagetrackr.com/*
// @icon         https://rs.ptrss.com/a/images/256.png
// @grant        none
// ==/UserScript==

(function() {
	'use strict';
	
	var aElementClassesToKill = ["fc-ab-root"];
	
	// Add observer to watch for new elements being added to the DOM
	// If the className of the element is in the aElementClassesToKill array, then .remove() that element immediately
	var observer = new MutationObserver(function(mutations) {
		mutations.forEach(function(mutation) {
			mutation.addedNodes.forEach(function(addedNode) {
				if( aElementClassesToKill.indexOf(addedNode.className) >= 0 ){
					console.log(`TamperMonkey, removing [".${addedNode.className}"] via "Kill PackageTrackr.com Ad Message`);
					addedNode.remove();
				}
			});
		});
	});
	
	observer.observe(document.body, {childList: true, subtree: true});
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址