eBay Grid View Expander

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

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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);
    }
})();