The best way to this is by replacing every HTTP & HTTPS in the HTML file with //. For Example:
With :
If the location protocol is HTTPS all links’ protocol will be changed to HTTPS and If the location protocol is HTTP all links’ protocol will be changed to HTTP.
For a mass replacement of links USE Regexxer.