Skip to content

Instantly share code, notes, and snippets.

@linuxwolf
linuxwolf / origin-search.md
Created January 18, 2018 22:48
searching on origin ...

Parse the URL

  • set aside { protocol, port }, ignore { path, search, target }
  • if !protocol; = "https", = ["http", "https"] if hostname = "localhost"
  • if !port; = "443" if "https", = "80" if "http", = "" anything else
  • if protocol = "javascript", skip search terms
  • If ERROR, skip search terms

determine "root" domain (name + Public Suffix List) full domain = URL.hostname Penultimate domain = root - 1 label (min "root" domain)

Keybase proof

I hereby claim:

  • I am linuxwolf on github.
  • I am linuxwolf (https://keybase.io/linuxwolf) on keybase.
  • I have a public key whose fingerprint is 31D7 588D EC90 690D 6BCC 98E0 ECF4 724E 109E 05BB

To claim this, I am signing this object: