In JavaScript you can check whether the url/website accessed is over Http or Https, via 2 ways
window.location.protocolwhich returnshttp:orhttps:window.isSecureContextwhich returnstrueforhttpsandfalseforhttp.
I know that window.isSecureContext is non-standardised. But lets say I know it is available at the client browser.
Then,
- what is the difference between the two read-only values? Which one to use?
- Most Importantly, In which case would there be an anomaly. Meaning, first method says
https:while second saysfalseor other way around.