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