support for http/https switching to avoid 'unsafe script' browser warnings