Created
August 25, 2021 19:30
-
-
Save c7x43t/2b27ddb6e84ebebe2e069c0c6332f620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/48011613/rendering-webgl-image-in-headless-chrome-without-a-gpu | |
(function(){ | |
var __getContext=HTMLCanvasElement.prototype.getContext; | |
Object.defineProperty(HTMLCanvasElement.prototype,'getContext',{ | |
configurable: true, | |
enumerable: true, | |
value: function getContext(contextType, contextAttributes={}){ | |
var options={ | |
premultipliedAlpha: false | |
} | |
return __getContext.call(this,contextType,Object.assign({},contextAttributes,options)) | |
}, | |
writable: true | |
}); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment