Advertisement
jcunews

FirefoxLocalAddonSearch

Jan 1st, 2022 (edited)
274
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*FirefoxLocalAddonSearch (run from browser console only)*/
  2. ((a, b) => {
  3.   if ((a = document.querySelector(".main-search")) && !window.asb) {
  4.     (b = a.insertBefore(document.createElement("INPUT"), a.firstChild)).id = "asb";
  5.     b.style.cssText = "position:absolute;left:2em";
  6.     b.oninput = i => {
  7.       i = b.value.trim().toUpperCase();
  8.       document.querySelectorAll("addon-card").forEach((ca, l) => {
  9.         if (l = ca.querySelector(".addon-name-link")) {
  10.           ca.style.display = i && l.title.toUpperCase().includes(i) ? "" : "none";
  11.         }
  12.       })
  13.     };
  14.     addEventListener("keydown", ev => {
  15.       if ((ev.key === "f") && ev.ctrlKey && !ev.shiftKey && !ev.altKey) {
  16.         ev.preventDefault();
  17.         ev.stopPropagation();
  18.         ev.stopImmediatePropagation();
  19.         asb.focus()
  20.       }
  21.     }, true)
  22.   }
  23. })()
Advertisement
RAW Paste Data Copied
Advertisement