features request in KHTML for interaction with another KDE project

Tobias Anton tobias.anton at esc-electronics.de
Mon Apr 18 16:53:12 BST 2005


Am Sonntag, 17. April 2005 19:01 schrieb Sebastien Raveau:
> On Sunday 17 April 2005 18:40, Tobias Anton wrote:
> > Your approach won't work in some complex cases. Imagine e.g. a page with
> > javaScript code that is executed onLoad. Assume further that this code
> > changes an IMG tag's "src"-attribute so the image referred to by the new
> > value will be loaded only after completion of the page itself. You won't
> > be able to intercept this URL, no matter how many libraries or function
> > calls you add to the parsing step of KHTML.
>
> I know: that's exactly what I was explaining in my very first email, when
> you said it was too long.

Hey, I just stated my opinion. No insult meant.

> > Otherwise, you'll be able to get a list of all links by creating a
> >       new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
> > and filter them by their href-attribute, doing the same for frames and
> > imgs with their src-attribute afterwards. This way, you can use KHTML for
> > parsing and retrieving the information you desire.
>
> Thanks, I'll try that :)
>
> > However, I have not yet understood why you want to interfere with KHTML
> > in that way, if hawKeye's main purpose is to show the links in a web
> > page...
>
> *sigh*
> That's not hawKeye's purpose at all...

So what is it? I understood that you want to make html pages available offline 
so that they can be rendered later on without an internet connection.

The easiest way to accomplish this is - imho - to change the default caching 
policy of kio_http to KIO::CC_CacheOnly. This sounds alot simpler than adding 
a proxy to your browser application. This caching policy - sometimes seen as 
offline browsing mode - will prevent khtml from doing any requests unless the 
reload flag is set in the KParts::URLArgs passed to openURL().

But AFAIK, these settings are global to kio_http and there's no way to make 
konqueror avoid reloads when a user request one, so I stopped investigating 
this matter long ago.

Cheers
Tobias




More information about the kfm-devel mailing list