I have black box javascript code (on some website) that I can't modify that requests to a certain domain. I want to make it request to localhost instead but I don't even know where to start.
At first I tried changing my hosts file but there was an error where the certificate I have installed on localhost was not valid for that domain (ERR_CERT_AUTHORITY_INVALID). I obviously can't get an certificate for a domain I don't own so I tried turning on #allow-insecure-localhost in chrome://flags but that didn't help.