amazon-sponsored

Remove "sponsored results" on Amazon.

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 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        amazon-sponsored
// @namespace   jimbo1qaz
// @description Remove "sponsored results" on Amazon.
// @include     *.amazon.com/*
// @version     1
// @grant       none
// @run-at      document-end
// ==/UserScript==
// @run-at      document-start
// @run-at      document-end
// @run-at      document-idle

{
	let arr = document.getElementsByClassName('s-result-item');
	let i = 0;
	while (i < arr.length){
		let el = arr[i];
		let sponsored = el.getElementsByClassName('s-sponsored-list-header');

		if (sponsored.length !== 0) {
			el.parentElement.removeChild(el);
		} else {
			i++;
		}
	}
	console.log(arr.length);
}