Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if (document.body.animate && typeof Animation === 'undefined') {
window.Animation = document.body.animate({}).constructor;
}
if (typeof Animation !== 'undefined' && Animation.prototype.finished === undefined) {
Object.defineProperty(Animation.prototype, 'finished', {get: function () {
if (this.__finishPromise) return this.__finishPromise;
if (this.playState === 'finished') {
this.__finishPromise = Promise.resolve();
} else {
this.__finishPromise = new Promise(function (resolve) {
this.addEventListener('finish', resolve, {once: true});
}.bind(this));
}
return this.__finishPromise;
}});
}
@AdaRoseCannon

This comment has been minimized.

Copy link
Owner Author

AdaRoseCannon commented Aug 19, 2017

@AdaRoseCannon

This comment has been minimized.

Copy link
Owner Author

AdaRoseCannon commented Aug 20, 2017

Thanks Šime Vidas for the Chrome fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.