Amazon - hide sponsored item in search result

This scripts high-lights all the sponsored contents on amazon search result page!

目前為 2022-10-27 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Amazon - hide sponsored item in search result
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  This scripts high-lights all the sponsored contents on amazon search result page!
// @author       You
// @license MIT
// @match        https://*.amazon.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=amazon.com
// @grant        none
// @require http://code.jquery.com/jquery-3.5.1.min.js
// ==/UserScript==
/* globals jQuery, $, waitForKeyElements */


(function() {
    'use strict';

    const sponsoredContents = $('div.AdHolder.s-result-item.s-asin div.a-row.a-spacing-micro span.a-declarative');
    if(sponsoredContents.length > 0) {
        $.each(sponsoredContents, function(index, item){
            if($(this).text().indexOf('Sponsored') > -1) {
                const s = $(this).find('span.a-color-secondary');
                const sHover = $(this).find('span.s-label-popover-hover');
                if(s) {
                    s.removeClass('a-color-secondary');
                    s.css({ 'color': 'red', 'font-size': '200%' });
                }
                if(sHover) {
                    sHover.removeClass('a-color-base');
                    sHover.css({ 'color': 'red', 'font-size': '120%' });
                }

                if(s || sHover){
                    $(this).parent().parent().parent().css({ 'background-color': 'grey'});
                }

            }
        });
    }
})();

QingJ © 2025

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