4 ms·
I once broke the "DRM" of a site which displayed images by downloading them obfuscated and using a big blob of JS to unfsck them and display them on a canvas. G
by ripdog 5y ago
I once broke the "DRM" of a site which displayed images by downloading them obfuscated and using a big blob of JS to unfsck them and display them on a canvas. Grabbing the image should be easy, no? Just use `.toDataURL()`, right? Well, this site deleted all the methods on the canvas object which could be used to grab the image data, and then `.freeze()` (or maybe it was `.seal()`, this was a while ago) to prevent the method being added back in.
In the end I said 'fuck it' and made a patched firefox build in a VM with freeze and/or seal disabled completely, then a small jetpack addon (remember them?) to unfsck the canvas element and grab them images.
- piperswe 5y agoYou probably could've used `HTMLCanvasElement.prototype.toDataURL.call` on the canvas element
- ripdog 5y agoHah, I knew a JS wizard would come up with an easier solution after I posted that. Perhaps I'll have to re-sub to that site to see if they've changed their DRM scheme...
- efreak 5y agoThat's easier than my solution. I've got a user script that backs up some methods that runs before the page loads, and a corresponding bookmarklet to restore them.