paulhammond / webkit2png

png screenshots of webpages

Home Page:http://www.paulhammond.org/webkit2png/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove support for multiple URLs

norm opened this issue · comments

When capturing multiple URLs from one instance of webkit2png, the following error occurs:

Python[10560:1107] *** WebKit discarded an uncaught exception in the webView:didFinishLoadForFrame: delegate: <NSUnknownKeyException> [<DOMAbstractView 0x7ff0650d3b30> valueForUndefinedKey:]: this class is not key value coding-compliant for the key webkit2png.

Have tracked it down to the new Webkit2PngScriptBridge. With the code for that commented out, it works fine.

(cc @spicyj as the original author of that)

I'm actually considering removing the ability to capture multiple urls in one webkit2png instance - it makes the code a lot messier, I'm fairly sure it's the source of a lot of bugs like this, it makes error handling difficult for calling scripts (because the entire process crashes when one url breaks) and it's not much easier than just using a bash for loop or similar.

On the other hand, it is slightly slower (although I haven't benchmarked this).

Thoughts?

I always used to capture one at a time, so this wouldn't upset me.

commented

I'd say we should strip out multiple URL support. The complexity isn't worth the limited functionality. It would be easy enough to add another script that takes a bunch of URLs and any webkit2png options and launches n processes, if someone really wanted out-of-the-box functionality.

@norm: Could you please provide more detail on what you commented? I have a need to process multiple URLs without the added slowdown of re-initializing WebKit. Thanks.

Closing in favor of #109