visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Setting opts.window should also update isLocation global variable #473

Open joshgillies opened 6 years ago

joshgillies commented 6 years ago

I'm currently playing around with page.js in a Worker context, and as a result of that environment having no native window object, etc I'm passing my own via page.setup({ window: {...} }) - however when it comes to initiating a route we get errors because isLocation is not set.

Would it be possible to update the isLocation variable based on the input object from opts.window?

matthewp commented 6 years ago

Yup! PR welcome here.