Added a polyfill for request animation frame