I have a JavaScript component (e.g. a date picker) that heavily depends on -

1. The current system time
2. The current system time zone

In Ruby and Capybara it's possible to stub any time with the help of libraries such as [Timecop](https://github.com/travisjeffery/timecop). 

Is it also possible to stub these values in the headless browser that Capybara controls? 

Thanks!

Edit: Here's an example of how Ruby is stubbed but Capybara's browser still uses the system time

```
before do
  now = Time.zone.parse("Apr 15, 2018 12:00PM")
  Timecop.freeze(now)

  visit root_path

  binding.pry
end

> Time.zone.now
=> Sun, 15 Apr 2018 12:00:00 UTC +00:00

> page.evaluate_script("new Date();")
=> "2018-03-27T04:15:44Z"

```