I'm not a programmer, but my work requires that I open multiple tabs at once. Whenever I find a certain word in a tab, I need to close it.
An example would be closing the tab for this page: http://ebay.com/itm/292769440348 if it has the word "ended" in it. I am currently trying the below script, but the tab closes even when the word "ended" is not detected.
Browser: Brave and Chrome Extension: Tempermonkey
$("div:contains('ended')").each(function()
{
window.close()
});
Can you explain which part I have wrong in my code?