eBay Grid View Expander

Increase the number of items viewed per row in eBay's grid view

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         eBay Grid View Expander
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Increase the number of items viewed per row in eBay's grid view
// @author       takanuva15
// @match        https://www.ebay.com/sch/*
// @match        https://www.ebay.com/str/*
// @grant        GM_addStyle
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // CSS to force more columns in the grid and adjust item sizes
    const customCSS = `
        /* remove side margins on main search results */
        :root {
            --page-width-max-sv: 100vw !important;
        }

        /* Shrink main search results cards slightly so more fit in a row */
        .srp-grid>.s-card {
            width: 16.66% !important;
        }

        /* remove side margins on store search results */
        .app-layout, .app-layout--gutters {
            max-width: unset !important;
        }
    `;

    // Inject the CSS as early as possible
    if (typeof GM_addStyle !== 'undefined') {
        GM_addStyle(customCSS);
    } else {
        const style = document.createElement('style');
        style.textContent = customCSS;
        document.head.appendChild(style);
    }
})();