The code in my background.js file is currently working as intended:
var targetList = ["youtube.com", "vimeo.com"];
for (var i = 0, n = targetList.length; i < n; i++) {
if (sender.tab.url.indexOf(targetList[i]) != -1) {
// do something
}
}
However, I now need to expand the targetList
with more references and use it multiple times within my background.js.
What would be the best approach to store the targetList
separately and access it when required? Do I need to make any changes to my manifest.json file?