[amends #102] Modify JS injection to match CSS injection behavior

@humancompanion, please refer to #102 for the why behind this. I've tested this with two different projects with no ill-effects. See any issues?