js: Check for https correctly