Google Search Layout Tweaks

Remove column gaps, enforce max-width + full previews, strip grid/flex layouts, margins & reset positions on Google web search only

Versión del día 5/5/2025. Echa un vistazo a la versión más reciente.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name        Google Search Layout Tweaks
// @description Remove column gaps, enforce max-width + full previews, strip grid/flex layouts, margins & reset positions on Google web search only
// @match       https://www.google.com/search?*
// @exclude     https://www.google.com/search?*tbm=nws*
// @run-at      document-start
// @version 0.0.1.20250505142620
// @namespace https://greasyfork.org/users/1435046
// ==/UserScript==

(function () {
  const css = `
    #rcnt {
      /*google search not news*/
      column-gap: 0 !important;
    }

    /* Apply max-width to every search-result wrapper */
    .MjjYud {
      max-width: 290px !important;
    }

    /* 2) Remove the -webkit-line-clamp limitation on the snippet */
    .VwiC3b.yXK7lf.p4wth.r025kc.hJNv6b.Hdw6tb {
      -webkit-line-clamp: unset !important;
    }

    /* Remove grid display on specific container */
    .YNk70c {
      display: unset !important;
    }

    .pZvJc { position: static !important; }
    .y6UnXe { display: block !important; }
.crJ18e {
    gap: 0px; !important;
    flex-wrap: wrap; !important;
}

.qogDvd {
    display: unset; !important
}

a.FgNLaf {
    display: none !important;
}

    /* Remove minimum width constraint */
    .YNk70c:not(.B2Ogle) {
      min-width: unset !important;
    }

    .NDnoQ {
      display: unset !important;
    }

    /* Remove left padding */
    .Efnghe {
      padding-left: 0 !important;
    }

/* Remove positioning on the search form container */
.CvDJxb,
#searchform {
  position: static !important;
}

/* Remove that top padding */
.e9EfHf {
  padding-top: 0 !important;
}

/* Hide the entire #sfcnt dodTBe container */
#sfcnt.dodTBe {
  display: none !important;
}



    /* Reset #fsl white-space to default */
    #fsl {
      white-space: normal !important;
    }
    `;
  const style = document.createElement('style');
  style.textContent = css;
  document.head.appendChild(style);

  const removeMargins = () => {
    Array.from(document.querySelectorAll('*')).forEach(el => {
      el.style.setProperty('margin', '0', 'important');
    });
  };

  // Run once at load
  document.addEventListener('DOMContentLoaded', removeMargins);

  // Rerun on every DOM mutation
  new MutationObserver(removeMargins).observe(document.documentElement, {
    childList: true,
    subtree: true,
    attributes: true,
    attributeFilter: ['style']
  });
})();