I'm working on a chrome extension and I'm using a lot of if statements to check the webpage for a list of words. And I have to continuously type each word over and over again but I'm wondering if there was a way to check the words one time through a list.
Currently I'm kinda working like this:
if (text == "apple")
if (text == "orange")
if (text == "Banana")
if (text == "Cherry")
if (text == "Lime")
and so on.. But is there a way to check a list of these words so I don't have so many if statements?
I was thinking of something like this:
List = "apple", "orange", "Banana", "Cherry", "Lime"
if (text == "list")
Is something like this possible in a Google Chrome Extension?