blacklistUrls not working

I have a 3rd party script on my site that I’m trying to blacklist and I can’t seem to get it work using a regexp

  blacklistUrls: [
   new RegExp(/(http[s]?:\/\/)?[^\s(["<,>]*\.tawk\.[^\s(["<,>]*/, 'g')
 ]

with an error of

{
description: {
isTrusted: True
}, 
sourceURL: https://embed.tawk.to/5b6ec498f31fddsfsdfsdf/default, 
type: TransportError
}

the regexp match all url that contain tawk.to but I’m still getting errors logged.

1 Like

Having the same issue with but with GTM URLs. I have:

	blacklistUrls: [
		// GTM/GA
		/\/(gtm|ga|analytics)\.js/,
		/\/(gtm|ga|analytics)\/js/,
		/\/(gtm|ga|analytics)\/js/,
		/(https?:\/\/www\.google-analytics\.com)/
	],

But still receiving events of errors inside GTM.js: