Post by joyrr5092 » 27 Feb 2024, 09:21
william_ahk wrote: ↑27 Feb 2024, 08:29
Since tank messed up the crawler bot prevention I was forced to use the forum search and needed the same thing. You can use this userscript I wrote for the search bar.
Code: Select all
// ==UserScript==
// @name Custom search options - Autohotkey Community
// @namespace Violentmonkey Scripts
// @match https://www.autohotkey.com/boards/*
// @grant none
// @version 1.0
// @author -
// @run-at document-end
// @description Set custom search options for the search bar
// ==/UserScript==
(() => {
const searchForm = document.getElementById('search');
if (!searchForm) {
return;
}
const searchOptions = {
//sf: 'titleonly',
sr: 'topics',
}
for (const name in searchOptions) {
var input = document.createElement("input");
input.name = name;
input.value = searchOptions[name];
input.type = 'hidden';
searchForm.appendChild(input);
}
})();
hi thx, but i am naive and dont know how to use it.
thanks
[quote=william_ahk post_id=560781 time=1709040591 user_id=108429]
Since tank messed up the crawler bot prevention I was forced to use the forum search and needed the same thing. You can use this userscript I wrote for the search bar.
[Codebox=javascript file=Custom search option.user.js]
// ==UserScript==
// @name Custom search options - Autohotkey Community
// @namespace Violentmonkey Scripts
// @match https://www.autohotkey.com/boards/*
// @grant none
// @version 1.0
// @author -
// @run-at document-end
// @description Set custom search options for the search bar
// ==/UserScript==
(() => {
const searchForm = document.getElementById('search');
if (!searchForm) {
return;
}
const searchOptions = {
//sf: 'titleonly',
sr: 'topics',
}
for (const name in searchOptions) {
var input = document.createElement("input");
input.name = name;
input.value = searchOptions[name];
input.type = 'hidden';
searchForm.appendChild(input);
}
})();
[/Codebox]
[/quote]
hi thx, but i am naive and dont know how to use it.
thanks