Prevent the code from running if there is no window.history object (for example if we are running under jsdom)