• Web APIs
  • Location interface is a string containing the protocol or scheme of the location's URL, including the final ":". If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".

    This property can be set to change the protocol of the URL. A ":" is appended to the provided string if not provided. The provided scheme has to be compatible with the rest of the URL to be considered valid.

    See

  • Specifications

    Specification
    Product help
  • host
  • pathname
  • assign()
  • toString()
  • ","source":{"folder":"en-us/web/api/location/protocol","github_url":"https://github.com/mdn/content/blob/main/files/en-us/web/api/location/protocol/index.md","last_commit_url":"https://github.com/mdn/content/commit/8cc63f7e6619446ea38f6a38c457a597a9af564b","filename":"index.md"},"summary":"The protocol property of the Location interface is a string containing the protocol or scheme of the location's URL, including the final \":\". If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, \"\".","title":"Location: protocol property","toc":[{"text":"Value","id":"value"},{"text":"Examples","id":"examples"},{"text":"Specifications","id":"specifications"},{"text":"Browser compatibility","id":"browser_compatibility"}],"baseline":{"baseline":"high","baseline_low_date":"2015-07-29","baseline_high_date":"2018-01-29","support":{"chrome":"1","chrome_android":"18","edge":"12","firefox":"1","firefox_android":"4","safari":"1","safari_ios":"1"}},"browserCompat":["api.Location.protocol"],"pageType":"web-api-instance-property"}}

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant