Skip to content

Commit

Permalink
🔧 fix bug for web worker (#667)
Browse files Browse the repository at this point in the history
1: document is not available for web worker
2: location is available for web worker/UI thread
  • Loading branch information
rdwh authored and PeterRao committed Oct 21, 2019
1 parent d200573 commit 655ee3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/browser/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function setRegion(region, internal, secure) {

// check local web protocol,if https secure default set true , if http secure default set false
function isHttpsWebProtocol() {
return document && document.location && document.location.protocol === 'https:';
return location && location.protocol === 'https:';
}

function Client(options, ctx) {
Expand Down

0 comments on commit 655ee3d

Please sign in to comment.