gi-webkit-3.0.14: WebKit bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.WebKit.Objects.WebDataSource

Contents

Description

Data source encapsulates the content of a WebFrame. A WebFrame has a main resource and subresources and the data source provides access to these resources. When a request gets loaded initially, it is set to a provisional state. The application can request for the request that initiated the load by asking for the provisional data source and invoking the webkit_web_data_source_get_initial_request method of WebDataSource. This data source may not have enough data and some methods may return empty values. To get a "full" data source with the data and resources loaded, you need to get the non-provisional data source through 'GI.WebKit.Objects.WebFrame.WebFrame'\'s webkit_web_frame_get_data_source method. This data source will have the data after everything was loaded. Make sure that the data source was finished loading before using any of its methods. You can do this via webkit_web_data_source_is_loading.

Synopsis

Exported types

Methods

getData

webDataSourceGetData Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m String

Returns: a String which contains the raw data that represents the dataSource or Nothing if the dataSource hasn't loaded any data.

Returns the raw data that represents the the frame's content.The data will be incomplete until the data has finished loading. Returns Nothing if the web frame hasn't loaded any data. Use webkit_web_data_source_is_loading to test if data source is in the process of loading.

Since: 1.1.14

getEncoding

webDataSourceGetEncoding Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m Text

Returns: the encoding name of the WebView or of the response.

Returns the text encoding name as set in the WebView, or if not, the text encoding of the response.

Since: 1.1.14

getInitialRequest

webDataSourceGetInitialRequest Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m NetworkRequest

Returns: the original NetworkRequest

Returns a reference to the original request that was used to load the web content. The NetworkRequest returned by this method is the request prior to the "committed" load state. See webkit_web_data_source_get_request for getting the "committed" request.

Since: 1.1.14

getMainResource

webDataSourceGetMainResource Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m WebResource

Returns: a new WebResource representing the main resource of the dataSource.

Returns the main resource of the dataSource

Since: 1.1.14

getRequest

webDataSourceGetRequest Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m NetworkRequest

Returns: the NetworkRequest that created the dataSource or Nothing if the dataSource is not attached to the frame or the frame hasn't been loaded.

Returns a NetworkRequest that was used to create this WebDataSource. The NetworkRequest returned by this method is the request that was "committed", and hence, different from the request you get from the webkit_web_data_source_get_initial_request method.

Since: 1.1.14

getSubresources

webDataSourceGetSubresources Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m [WebResource]

Returns: a List of WebResource objects; the objects are owned by WebKit, but the GList must be freed.

Gives you a List of WebResource objects that compose the WebView to which this WebDataSource is attached.

Since: 1.1.15

getUnreachableUri

webDataSourceGetUnreachableUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m Text

Returns: the unreachable URL of dataSource or Nothing if there is no unreachable URL.

Return the unreachable URI of dataSource. The dataSource will have an unreachable URL if it was created using 'GI.WebKit.Objects.WebFrame.WebFrame'\'s webkit_web_frame_load_alternate_html_string method.

Since: 1.1.14

getWebFrame

webDataSourceGetWebFrame Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m WebFrame

Returns: the WebFrame that represents the dataSource. The WebFrame is owned by WebKit and should not be freed or destroyed. This will return Nothing if the dataSource is not attached to a frame.

Returns the WebFrame that represents this data source

Since: 1.1.14

isLoading

webDataSourceIsLoading Source #

Arguments

:: (HasCallStack, MonadIO m, IsWebDataSource a) 
=> a

dataSource: a WebDataSource

-> m Bool

Returns: True if the dataSource is still loading, False otherwise

Determines whether the data source is in the process of loading its content.

Since: 1.1.14

new

webDataSourceNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m WebDataSource

Returns: a new WebDataSource.

Creates a new WebDataSource instance. The URL of the WebDataSource will be set to "about:blank".

Since: 1.1.14

newWithRequest

webDataSourceNewWithRequest Source #

Arguments

:: (HasCallStack, MonadIO m, IsNetworkRequest a) 
=> a

request: the NetworkRequest to use to create this data source

-> m WebDataSource

Returns: a new WebDataSource

Creates a new WebDataSource from a NetworkRequest. Normally, WebFrame objects create their data sources so you will almost never want to invoke this method directly.

Since: 1.1.14