Set focus to text field (Youtube)
Hi.
I already asked the same here and got a solution response from member Anagrammar.
I was trying to set focus to a text field at FacebookDownload page.
Solution was to use Greasemonkey and user script like this:
Now, I'm trying to do the same at Youtube page.
I tried to put
and
but none worked.
Any ideas?
I already asked the same here and got a solution response from member Anagrammar.
I was trying to set focus to a text field at FacebookDownload page.
Solution was to use Greasemonkey and user script like this:
document.querySelector('.form-control[name="URLz"]').focus();
Now, I'm trying to do the same at Youtube page.
I tried to put
document.querySelector('.form-control[name="search"]').focus();
and
document.querySelector('.form-control[id="search"]').focus();
but none worked.
Any ideas?
Comments
* https://greasyfork.org/en/forum/
* https://openuserjs.org/forum
Or maybe someone here can figure out how the YouTube box works in the Polymer design...
There is no
.form-control
so it won't work. Two ways to do it, that I can think of:Will affect any input element that has #search id.
document.querySelector('input#search').focus();
Should affect only the search element on the navbar.
document.querySelector('input#search.ytd-searchbox').focus();