Get current protocol from URL (http or https) 14 February 201014 April 2016 SheldonNo Comments To get the protocol used for the current page: var protocol = window.location.protocol Share this: Share on LinkedIn (Opens in new window) LinkedIn Share on Facebook (Opens in new window) Facebook Share on WhatsApp (Opens in new window) WhatsApp Share on Pinterest (Opens in new window) Pinterest Email a link to a friend (Opens in new window) Email Print (Opens in new window) Print Share on Tumblr (Opens in new window) Tumblr Share on Reddit (Opens in new window) Reddit Share on Mastodon (Opens in new window) Mastodon Share on Telegram (Opens in new window) Telegram Share on X (Opens in new window) X Share on Nextdoor (Opens in new window) Nextdoor