How about asynchronously downloading the page HTML into a string, doing a text 
replace of the name of the CSS file to your local one, then passing the 
modified HTML to the web view?

Sent from my iPhone

On Aug 18, 2012, at 6:52 AM, Koen van der Drift <koenvanderdr...@gmail.com> 
wrote:

> 
> On Aug 18, 2012, at 7:24 AM, Koen van der Drift <koenvanderdr...@gmail.com> 
> wrote:
> 
>> In my OS X app I show some webpages in a WebView, but I'd like to show them 
>> stripped down, remove clutter, e.g. as is done in Evernote and other apps. 
>> 
>> Any suggestions where to start? Maybe use a local css file?
>> 
> 
> 
> Answering to myself...
> 
> 
> Alright, I found some clues on SO, and am now able to replace the css file 
> with my own by tweaking the DOMDocument.  The only place I could think of to 
> do this is in
> 
> - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
> 
> But since the webview loads asynchronously,  I first see the page with the 
> original css for a second or two, and then it changes to the page using my 
> local css file only after the whole page has loaded.
> 
> Is there another place where I could hook into so the page shows correctly 
> immediately?  
> 
> 
> Next is to strip the DOM form all elements I don't need :)
> 
> - Koen.
> 
> 
> 
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/punster%40mac.com
> 
> This email sent to puns...@mac.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to