nodeca / tabex

Cross-tab message bus for browsers.
http://nodeca.github.io/tabex/
MIT License
219 stars 19 forks source link

Tabex does not work with node js #20

Closed Ruslan0087 closed 6 years ago

Ruslan0087 commented 6 years ago

When trying to require tabex from node.js enviroment I have next error:

...\node_modules\tabex\lib\timer.js:7 var URL = window.URL; ^ ReferenceError: window is not defined at Object. (...\node_modules\tabex\lib\timer.js:7:11) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Module.require (module.js:568:17) at require (internal/module.js:11:18) at Object. (...\node_modules\tabex\lib\router.js:7:13) at Module._compile (module.js:624:30)

Window is not defined and tabex has no possibility to pass window object to tabex ctor, like jQuery has.

puzrin commented 6 years ago

Works as expected. This package is for the browsers.