hoixw / SmartFrameDownloader

Tampermonkey script to bypass SmartFrame Image DRM
MIT License
1 stars 0 forks source link

toDataURL error #1

Closed iamvitali closed 6 months ago

iamvitali commented 7 months ago

When clicking the button "Download Hi-Res" it enlarges the image but doesn't download it and throws an error in the console:

image

image

hoixw commented 7 months ago

Which website was this on?

I will take a look at the issue now, but it looks like SmartFrame updated their DRM from what I'm seeing.

hoixw commented 7 months ago

Finally had some time to take a look at it — yes, they had updated their DRM. They now use 'closed shadow DOMs', which are a unique little feature designed to be totally inaccessible to JS code. It took me a while to figure out how to bypass this, especially given I'm trying to break a feature written by someone smarter than me.

Nonetheless, I have a solution:

The button appears as normal but clicking it results in a refresh, and on refresh, the shadow DOM code is hijacked, resulting in every shadow DOM being 'open'. They can't be accessed normally (so the code needed a little updating), but they can be accessed, so it now works :D.

I've tested it on the sample websites in the readme — coventry.digital and the Historic England archive. Let me know if it works for you on whatever site you were using, and if it does, I will close the issue.