Skip to content

Instantly share code, notes, and snippets.

@domenic
Created September 28, 2020 15:40
Show Gist options
  • Save domenic/49d7d2ec209bfae109ce6ec52148dffc to your computer and use it in GitHub Desktop.
Save domenic/49d7d2ec209bfae109ce6ec52148dffc to your computer and use it in GitHub Desktop.
Alternate same-site algorithms

Two origins, A and B, are said to be same site if the following returns true:

  1. Let siteA be the result of obtaining a site from A.
  2. Let siteB be the result of obtaining a site from B.
  3. Return true if siteA equals siteB.

Two origins, A and B, are said to be schemelessly-same site if the following returns true:

  1. Let siteA be the result of obtaining a site from A.
  2. Let siteB be the result of obtaining a site from B.
  3. Return true if either siteA and siteB are both the same opaque origin, or siteA[1] equals siteB[1].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment