Yes, with uMatrix. Its like ublock but much more configurable. In one dimension you have cookies, images, js, xmlhttprequest, frames, etc; in another dimension you have domain, subdomain, TLD of the site URL; and in the third dimension you have domains that your current site is connected to. Each is configurable at different levels.
It is archived though. The developed stopped working on it I believe