Last active
January 23, 2025 09:47
-
-
Save LatinSuD/b86280e571ce7fb22b0e2808a0c99ab0 to your computer and use it in GitHub Desktop.
Revisions
-
LatinSuD revised this gist
Jan 23, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Please edit the "@match" line above to match your URL if (b2) { b2.value = new URLSearchParams(window.location.search).get('search'); console.log("Lanzando busqueda " + b2.value) b2.dispatchEvent(new KeyboardEvent('input',{'key':'a'})); clearInterval(inter); -
LatinSuD created this gist
Sep 9, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ // ==UserScript== // @name Wiki.js Search // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://mydomain.com/?search=* // @grant none // @run-at document-idle // ==/UserScript== /***** Please edit the "@match" line above to match your URL *****/ (function() { 'use strict'; function querySelectorIncludesText (selector, text){ return Array.from(document.querySelectorAll(selector)) .find(el => el.textContent.includes(text)); } var inter=setInterval(function() { var b=querySelectorIncludesText('LABEL','Buscar...'); if (b) { var b2=document.getElementById(b.getAttribute('for')) if (b2) { b2.value=location.href.replace(/[^?]*\?search=/,"") console.log("Lanzando busqueda " + b2.value) b2.dispatchEvent(new KeyboardEvent('input',{'key':'a'})); clearInterval(inter); } } }, 50) })();