API-Version: 1.9

WebKitDownload

Object that can be used for downloads

new WebKitDownload(url)

Constructs a new download

Parameters:
Name Type Description
url String

The url of the download

Source:
Returns:

WebKitDownLoad

Extends

Methods

blockSignal(id)

Blocks emission of a signal

Parameters:
Name Type Description
id Number

The signal id retrieved from GObject#connect

Inherited From:
Source:

cancel()

Cancels a download

Source:

connect(name, callback, after) → {Number}

Connect to a GObject-signal. Note that all signals are connected using the signal::- or with notify::-prefix. If connecting to a signal the signal::-prefix must be omitted. The callback function will have the same parameters as the GObject signal callback without the first parameter, however some parameters may be undefined if they cannot be converted to javascript objects. All signal handlers are executed after dwb’s default handler.

Parameters:
Name Type Argument Description
name String

The signal name.

callback GObject~connectCallback

Callback that will be called when the signal is emitted.

after Boolean <optional>

Whether to connect after the default signal handler.

Inherited From:
Source:
Returns:

The signal id of this signal

Type
Number

connectBlocked(name, callback, after) → {Number}

Connect to a gobject-signal but block the emission of the own callback during execution of the callback. Useful if the object is connected to a notify event and the the property is changed in the callback function.

Parameters:
Name Type Argument Description
name String

The signal name.

callback Function

Callback that will be called when the signal is emitted.

after Boolean <optional>

Whether to connect after the default signal handler.

Inherited From:
Source:
Returns:

The signal id of this signal

Type
Number

disconnect(id) → {Boolean}

Disconnects from a signal

Parameters:
Name Type Description
id Number

The signal id retrieved from GObject.connect

Inherited From:
Source:
Returns:

Whether a signal was found and disconnected

Type
Boolean

notify(name, callback, after) → {Number}

Connects to a property change notification

Parameters:
Name Type Argument Description
name String

The property name, can also be in camelcase.

callback GObject~notifyCallback

Callback that will be called when the property changes

after Boolean <optional>

Whether to connect after the default handler.

Inherited From:
Source:
Returns:

The signal id of this signal

Type
Number

notifyBlocked(name, callback, after) → {Number}

Connects to a property change notification but with signal blocking. Must be used if the property is modified in the callback function.

Parameters:
Name Type Argument Description
name String

The property name, can also be in camelcase.

callback GObject~notifyCallback

Callback that will be called when the property changes

after Boolean <optional>

Whether to connect after the default handler.

Inherited From:
Deprecated:
  • Yes
Source:
Returns:

The signal id of this signal

Type
Number
Example
 
gui.statusLabel.notifyBlocked("label", function() {
     this.label += "foo"; 
});

start(callback) → {Boolean}

Starts a download

Parameters:
Name Type Description
callback WebKitDownload~statusCallback

Callback function that will be executed whenever the DownloadStatus changes

Source:
Returns:

true if the download was started

Type
Boolean

unblockSignal(id)

Unblocks a signal that was blocked with GObject#blockSignal

Parameters:
Name Type Description
id Number

The signal id retrieved from GObject#connect

Inherited From:
Source:

Type Definitions

statusCallback(download)

Parameters:
Name Type Description
download WebKitDownload

The download

Source: