Skip to content

Instantly share code, notes, and snippets.

@medanisjbara
Last active April 4, 2023 14:27
Show Gist options
  • Save medanisjbara/67ce19000d359e10c2073e2a3a52225b to your computer and use it in GitHub Desktop.
Save medanisjbara/67ce19000d359e10c2073e2a3a52225b to your computer and use it in GitHub Desktop.
/*
A script that restores functionality to the search bar of primini.tn
If you're concerned about your privacy and you want to use that website.
Make sure to disable javascript on that website using the extension from noscript.net
And use this user script to still be able to search inside the website.
*/
document.getElementsByClassName('sui-search-box__container')[0].innerHTML = `
<form action="/c/search" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-labelledby="downshift-0-label">
<div class="sui-search-box">
<div class="sui-search-box__wrapper">
<input aria-labelledby="downshift-0-label" autocomplete="off" id="downshift-0-input" data-transaction-name="search input" placeholder="Rechercher un produit ou une catégorie ..." class="sui-search-box__text-input " value="" name="q">
</div>
<input data-transaction-name="search submit" type="submit" class="button sui-search-box__submit" value="Recherche">
</div>
</form>
`
" This is who I do it in tridactyl. Tnaks to @bovine3dom:matrix.org for the help in making this.
autocmd DocStart https://primini.tn/$ js let searchFixer = setInterval(()=>{let searchBoxes = document.getElementsByClassName('sui-search-box__container'); if (searchBoxes.length > 0){ searchBoxes[0].innerHTML = '<form action="/c/search" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-labelledby="downshift-0-label"><div class="sui-search-box"><div class="sui-search-box__wrapper"><input aria-labelledby="downshift-0-label" autocomplete="off" id="downshift-0-input" data-transaction-name="search input" placeholder="Rechercher un produit ou une catégorie ..." class="sui-search-box__text-input " value="" name="q"></div><input data-transaction-name="search submit" type="submit" class="button sui-search-box__submit" value="Recherche"></div></form>'; clearInterval(searchFixer)}},500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment