I guess whatever works for you, you can think of Network.setBlockedURLs as a much simpler interface with respect to Network.setRequestInterception. The latter might be overkill if you just need to block a set of resources by URL while it might be OK if you need to support more advanced conditions based on the whole request instead of just the URL.
i'll be use the datasets to block ads, which methods suitable for such big datasets?
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts",
"https://mirror1.malwaredomains.com/files/justdomains",
"http://sysctl.org/cameleon/hosts",
"https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist",
"https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt",
"https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt",
"https://hosts-file.net/ad_servers.txt",
"http://winhelp2002.mvps.org/hosts.txt"
My guess is that Network.setBlockedURLs might be the best choice, but you should really try both and measure the performance to properly compare the two methods.
@cyrus-and how does Network.setBlockedURLs scales with a big list of urls to block? Would that introduce any overhead in the network performances if I had 20, 100, 1000, more...paterns blocked?
@gsouf honestly I have no idea, your best bet is to measure it. You might also want to ask this here.
@cyrus-and if you are interested here we got an answer https://groups.google.com/d/msg/chrome-debugging-protocol/SUZ7LHZlh1E/l0DZtX_PDAAJ
@gsouf got it thank you!