Skip to content

Conversation

Everettss
Copy link

We want to debug service worker on localhost. More details in this issue #268

@daliborgogic
Copy link

daliborgogic commented Dec 16, 2017

What about IPv6?

const isLocalhost = Boolean(
  location.hostname === 'localhost' ||
  location.hostname === '[::1]' ||
  location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)
)

edited: extra space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants