I have a WebView that displays some content, which is frequently updated. I would like to display a page counter in my UI which would tell the user how many pages would web view have if they would to print it.

I have tried doing:

NSRange r = NSMakeRange(0, 0);
BOOL knows = [[[[webView mainFrame] frameView] documentView] knowsPageRange: &r];

which gives knows = YES but r.length always equals 1.

How can I get at this information? (Preferably in a performant way, if possible).

Edit
Report