How to match a URL from a tab with an Array of URL's - Google Chrome Extension?

The same, except you would loop through the array.

The same, except you would loop through the array: function checkForValidUrl(tabId, changeInfo, tab) { for (var I = 0, iLen = urlArray. Length; I -1) { chrome.pageAction. Show(tabId); notification.show(); break; // halt for loop } } }; Another option would be to use a regular expression and use if (tab.url.

Match(re)) instead, where re could be something like /example\. Com|example\. Org|google\.

Com/.

If the array is small you can just iterate over it and check. If it's significantly bigger, Your best method would be to pre-sort it and do a binary serach on it. Another option can be to concatenate your array to a single string and then just check for an existance in this string (either with indexOf or with regex).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions