What if I do:<p>delete CanvasRenderingContext2D.prototype.toDataURL;<p>Shouldn’t delete set the function back to native code?<p>Same with:<p>const offscreen = new OffscreenCanvas(1, 1);
const nativeToDataURL = Object.getPrototypeOf(offscreen.getContext("2d")).toDataURL;<p>Object.defineProperty(CanvasRenderingContext2D.prototype, "toDataURL", {
value: nativeToDataURL,
writable: true,
configurable: true
});<p>Or:<p>const iframe = document.createElement("iframe");
document.body.appendChild(iframe);
const nativeToDataURL = iframe.contentWindow.CanvasRenderingContext2D.prototype.toDataURL;
document.body.removeChild(iframe);<p>CanvasRenderingContext2D.prototype.toDataURL = nativeToDataURL;<p>I beg your pardon if my question is full of innocence.