I am creating an Tampermonkey userscript that would automatically click the "star" button on Google Translate website and save my searches so that I can later view them and rehearse.
This is the button that I am targeting:
This is what I've got so far:
// @match https://translate.google.com/#en/de/appetit/
var el = document.getElementById("gt-pb-star");
setTimeout(function(){
el.click();
},4000);
I encountered 2 problems.
@match
should be every translate.google.com search and not just appetit. How do I specify the whole domain?- I tried clicking the "star" button with click() method but it doesn't work. Not sure why.
Can you please help me finish this userscript?
Edit: it seems that setting match
to https://translate.google.com/
handles the first question. Still don't know why click() doesn't work.