I'm trying to write a script that will take information (cookies, etc.) and send it off to a domain I own as a post request using Ajax. The script is supposed to execute once the page loads. The thing is, this won't work if the page the script is on is served over https, because the domain I own doesn't use SSL, and Same Origin Policy stops that. It costs extra money and I'd rather make that purchase for a more legitimate reason if I need to.
So I was thinking of adding a line to the script that changes the location.protocol BOM from https: to http:, but when the command executes, the browser will try to request the page it's on over http, effectively reloading the page and never letting the script fully execute, looping, fucking things up, and so on.
Is there a way to change location.protocol without the browser sending a new request? I just want to make the browser think that the current https page was actually served over http so that a response from my domain doesn't also need to be served over https.
Or is there a better way to do this?