Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 99677f8

Browse files
authored
Merge pull request #523 from dryajov/master
feat: change window to self for webworker support
2 parents 2d20ddf + e2e3213 commit 99677f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function IpfsAPI (hostOrMultiaddr, port, opts) {
2929

3030
// autoconfigure in browser
3131
if (!config.host &&
32-
typeof window !== 'undefined') {
33-
const split = window.location.host.split(':')
32+
typeof self !== 'undefined') {
33+
const split = self.location.host.split(':')
3434
config.host = split[0]
3535
config.port = split[1]
3636
}

0 commit comments

Comments
 (0)