CHG: reworked the way the injection script works, to cover both http and https targets