Google Search Results Count

On May 7, 2024, Google Search changed its interface to hide the number of search results by default. This script restores the visibility of the search result count by appending it to the top bar.

  1. // ==UserScript==
  2. // @name Google Search Results Count
  3. // @version 2024-06-22
  4. // @description On May 7, 2024, Google Search changed its interface to hide the number of search results by default. This script restores the visibility of the search result count by appending it to the top bar.
  5. // @author Mohan
  6. // @match https://*.google.com/search?*
  7. // @include /^https?://(?:www|encrypted|ipv[46])\.google\.[^/]+/(?:$|[#?]|search|webhp)/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
  9. // @grant none
  10. // @namespace https://greasyfork.org/users/1321961
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function appendResultStats(retries) {
  17. var resultStats = document.getElementById('result-stats');
  18. var appbar = document.getElementById('appbar');
  19.  
  20. if (resultStats && appbar) {
  21. appbar.appendChild(resultStats.cloneNode(true));
  22. } else if (retries > 0) {
  23. setTimeout(function() {
  24. appendResultStats(retries - 1);
  25. }, 1000);
  26. }
  27. }
  28.  
  29. window.addEventListener('load', function() {
  30. appendResultStats(3);
  31. }, false);
  32. })();