Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rishoej on github.
  • I am tobiasrr (https://keybase.io/tobiasrr) on keybase.
  • I have a public key ASBGRTxmEzfNnGOpEkdL2uom4s-FpkSkGseAk0kJtTF2dAo

To claim this, I am signing this object:

@rishoej
rishoej / Monkey patch window.location.origin typescript
Created September 18, 2018 08:51
Monkey patch window.location.origin with typescript
if (!window.location.origin) {
// window.location.origin is "readonly", not sure how to overwrite that so use any type for this.
const wl: any = window.location
const port = wl.port ? `:${wl.port}` : ''
wl.origin = `${wl.protocol}//${wl.hostname}${port}`
}