Closed sdht0 closed 1 year ago
Thank you, I was able to reproduce the issue. Unfortunately, it's a bit harder than usual to debug. I suspect this page overrides standard APIs with non-compliant implementations.
Edit: For the record, the error is thrown when SingleFile generates stylesheet contents.
Just got the same issue with many links on the Web Archive:
Evaluation failed: TypeError: Cannot read properties of undefined (reading 'dataset')
@melyux Can you give me an example of link that would allow me to reproduce your issue?
@sdht0 I did some investigation on this particular issue and found the problem. It's due to a script on the page which overrides the native method Function#bind
with a non-compliant implementation. Hopefully, this is a practice that is considered as bad for at least 10 years. So, this should me more and more rare. Meanwhile, I added an option --browser-freeze-prototypes
to freeze the native methods and circumvent this kind of problem.
@gildas-lormeau I had a similar thing with Web Archive, this is an example of a page where SingleFile CLI threw this error.
Thanks a lot @gildas-lormeau! Meanwhile I had sidestepped the issue by simply downloading the whole website using wget ;). Their print view is pretty handy (e.g., http://highscalability.com/blog/2023/7/16/lessons-learned-running-presto-at-meta-scale.html?printerFriendly=true).
@readstead Thank you for the additional info, I was able to reproduce and fix the issue in the last version I just published.
@sdht0 You did the right thing ;) And it's true that the page intended for printing is perfect!
Just tried and it's working great now. You are the man
@melyux Thank you :)
Hi. I get the following error on seemingly any web page from "http://highscalability.com" when using
single-file-cli
. However the firefox extension works as expected. Can you investigate? Thanks.