CORS debugging trick

last updated: Oct 20, 2023

a CORS error throws a securitypolicyviolation event. This would have saved me some time debugging in the past if I knew it!

document.body.addEventListener(  
	"securitypolicyviolation",  
	(e) => { console.log(e) }  
)

via this toot by Vincent Tunru

↑ up