simplify https detection for loading scripts