Skip to content

Commit

Permalink
Merge pull request #59 from ilyagelman/nativescript
Browse files Browse the repository at this point in the history
add support for nativescript by assigning global to window
  • Loading branch information
morsdyce authored Mar 10, 2017
2 parents 5437695 + 51a1676 commit 9d8e0b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dist/xhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ WINDOW = null;

if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
WINDOW = self;
} else if (typeof global !== 'undefined') {
WINDOW = global;
} else {
WINDOW = window;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/xhook.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/xhook.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
WINDOW = null;
if typeof WorkerGlobalScope isnt 'undefined' && self instanceof WorkerGlobalScope
WINDOW = self
else if typeof global isnt 'undefined'
WINDOW = global
else
WINDOW = window

Expand Down

0 comments on commit 9d8e0b7

Please sign in to comment.