Bug 16104

Summary: [GTK] There is no way to retrieve the frame source
Product: WebKit Reporter: Christian Dywan <christian>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: jmalonzo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Linux   
Attachments:
Description Flags
Implement webkit_frame_get_string
alp: review-
Implement webkit_frame_copy_source alp: review-

Description Christian Dywan 2007-11-23 14:14:09 PST
There is no way to retrieve the source of a website as a string.
Comment 1 Christian Dywan 2007-11-23 14:16:05 PST
Created attachment 17471 [details]
Implement webkit_frame_get_string

I went with _string instead of _markup because this has nothing to do with GMarkup.
Comment 2 Alp Toker 2007-11-23 18:14:39 PST
Comment on attachment 17471 [details]
Implement webkit_frame_get_string

We need to figure out what to do about string lifecycle first.

There is no indication of how long the buffer will be valid here, if at all. Looks wrong to me.
Comment 3 Christian Dywan 2007-11-25 08:54:53 PST
Created attachment 17508 [details]
Implement webkit_frame_copy_source

I changed the name to avoid some confusion.

As _copy suggests the function now allocates a new string because we don't know how long the buffer is valid. And caching behind the scenes doesn't seem to be a good idea here.
Comment 4 Alp Toker 2007-11-25 14:43:01 PST
Comment on attachment 17508 [details]
Implement webkit_frame_copy_source

The trouble here is that the frame source may be in different formats, and copying is not great either. Not sure that returning a const gchar* is a good general way of representing this in a way that we can stick to in the long term.

We should try to do something more like the ObjC API now that we're following it more closely.
Comment 5 Alp Toker 2007-11-25 14:43:45 PST
(In reply to comment #4)
> (From update of attachment 17508 [details] [edit])
> The trouble here is that the frame source may be in different formats, and
> copying is not great either. Not sure that returning a const gchar* is a good
> general way of representing this in a way that we can stick to in the long
> term.

s/const//
Comment 6 Jan Alonzo 2008-03-21 01:31:13 PDT
Is the proposed patch here the same as webkit_web_frame_get_name? If so can we close this?
Comment 7 Christian Dywan 2008-03-21 05:50:17 PDT
(In reply to comment #6)
> Is the proposed patch here the same as webkit_web_frame_get_name? If so can we
> close this?

Not at all. This is about the source code of the frame in text form. Maybe you confused bugs here?
Comment 8 Jan Alonzo 2009-04-19 01:18:50 PDT
Bug #24758 implements a WebDataSource which we can use to get the source of a frame. Though, it also uses const gchar* to return the source, feedback would be appreciated on what is best to represent the source in that bug report. Thanks.

*** This bug has been marked as a duplicate of 24758 ***