Skip to content

Instantly share code, notes, and snippets.

View pseudosavant's full-sized avatar

Paul Ellis pseudosavant

View GitHub Profile
@pseudosavant
pseudosavant / createImageBitmap.js
Last active March 20, 2022 12:30 — forked from MonsieurV/createImageBitmap.js
createImageBitmap polyfill with support for CanvasImageSource (img, video, canvas) sources, Blobs, and ImageData. https://createimagebitmap-polyfill.glitch.me/
/*
* Polyfill for createImageBitmap
* https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap
*
* Supports CanvasImageSource (img, video, canvas) sources, Blobs, and ImageData.
*
* From:
* - https://dev.to/nektro/createimagebitmap-polyfill-for-safari-and-edge-228
* - https://gist.github.com/MonsieurV/fb640c29084c171b4444184858a91bc7
* Updated by:
var output = (function ( object ) {
"use strict";
var names = [];
var props = Object.getOwnPropertyNames( object );
var proto = Object.getPrototypeOf( object );
while ( proto ) {
names = Object.getOwnPropertyNames( proto );