Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
feat: change window to self for webworker support
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriy ryajov authored and dmitriy ryajov committed Feb 12, 2017
1 parent 2d20ddf commit e2e3213
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ function IpfsAPI (hostOrMultiaddr, port, opts) {

// autoconfigure in browser
if (!config.host &&
typeof window !== 'undefined') {
const split = window.location.host.split(':')
typeof self !== 'undefined') {
const split = self.location.host.split(':')
config.host = split[0]
config.port = split[1]
}
Expand Down

0 comments on commit e2e3213

Please sign in to comment.