There is a crossorigin attribute that can be added to many HTML element which could request resources from other domains. The crossorigin attribute has two possible values - anonymous and use-credentials. The one you pick will determine the way the browser handles those resource requests.
Code GIST: https://gist.github.com/prof3ssorSt3v3/dd95fe5114e6bf04f5dc3bbea32d486c