Closed zalmoxisus closed 8 years ago
Thanks! but it will match example http://example.com/#https://github.com
URL.
I think use new RegExp('^(' + arrowURLs.join('|') + ')')
will be better, can you update it? :D
Yes, I missed that, and \.
, otherwise it would match, for example https://github-com.com
. Wouldn't it be better to ad ^
in the arrowURLs
to be more flexible? Like const arrowURLs = [ '^https://github\\.com' ]
.
And I guess new RegExp
could be removed as it was before. From match
documentation:
If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj).
@zalmoxisus ok! :) We can use regex in arrowURLs.
The previous condition impose that the
tab.url
matches all the urls, which will never be true if we have more than one value inarrowUrls
.