Greasy Fork 支持简体中文。

Homebrew search result pop-up

Pops up the Homebrew website (brew.sh) search results when arriving via a direct link

  1. // ==UserScript==
  2. // @name Homebrew search result pop-up
  3. // @version 2.0
  4. // @author wtflm
  5. // @namespace wtflm
  6. // @description Pops up the Homebrew website (brew.sh) search results when arriving via a direct link
  7. // @include /^https:\/\/formulae\.brew\.sh\/.*(\?|&)search=/
  8. // @grant none
  9. // ==/UserScript==
  10. const container = document.getElementById("search-container");
  11. const observer = new MutationObserver(() => {
  12. search = document.querySelector(".DocSearch");
  13. search.dispatchEvent(new Event("click"));
  14. observer.disconnect();
  15. });
  16. observer.observe(container, {childList:true});