Verifique si URL es HTTP o HTTPS JavaScript

You can make use of `window` keyword
=> window.location.protocol
D@RK$T@R