WebKit2WebExtension.ScriptWorld

g GObject.Object GObject.Object WebKit2WebExtension.ScriptWorld WebKit2WebExtension.ScriptWorld GObject.Object->WebKit2WebExtension.ScriptWorld

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_default ()

class

new ()

class

new_with_name (name)

get_name ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

window-object-cleared

Emitted when the JavaScript window object in a WebKit2WebExtension.ScriptWorld has been cleared.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2WebExtension.ScriptWorld(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit2WebExtension.ScriptWorldClass

classmethod get_default()
Returns:

the default WebKit2WebExtension.ScriptWorld

Return type:

WebKit2WebExtension.ScriptWorld

Get the default WebKit2WebExtension.ScriptWorld. This is the normal script world where all scripts are executed by default. You can get the JavaScript execution context of a WebKit2WebExtension.ScriptWorld for a given WebKit2WebExtension.Frame with webkit_frame_get_javascript_context_for_script_world().

New in version 2.2.

classmethod new()
Returns:

a new isolated WebKit2WebExtension.ScriptWorld

Return type:

WebKit2WebExtension.ScriptWorld

Creates a new isolated WebKit2WebExtension.ScriptWorld. Scripts executed in isolated worlds have access to the DOM but not to other variable or functions created by the page. The WebKit2WebExtension.ScriptWorld is created with a generated unique name. Use WebKit2WebExtension.ScriptWorld.new_with_name() if you want to create it with a custom name. You can get the JavaScript execution context of a WebKit2WebExtension.ScriptWorld for a given WebKit2WebExtension.Frame with webkit_frame_get_javascript_context_for_script_world().

New in version 2.2.

classmethod new_with_name(name)
Parameters:

name (str) – a name for the script world

Returns:

a new isolated WebKit2WebExtension.ScriptWorld

Return type:

WebKit2WebExtension.ScriptWorld

Creates a new isolated WebKit2WebExtension.ScriptWorld with a name. Scripts executed in isolated worlds have access to the DOM but not to other variable or functions created by the page. You can get the JavaScript execution context of a WebKit2WebExtension.ScriptWorld for a given WebKit2WebExtension.Frame with webkit_frame_get_javascript_context_for_script_world().

New in version 2.22.

get_name()
Returns:

the name of self

Return type:

str

Get the name of a WebKit2WebExtension.ScriptWorld.

New in version 2.22.

Signal Details

WebKit2WebExtension.ScriptWorld.signals.window_object_cleared(script_world, page, frame)
Signal Name:

window-object-cleared

Flags:

RUN_LAST

Parameters:

Emitted when the JavaScript window object in a WebKit2WebExtension.ScriptWorld has been cleared. This is the preferred place to set custom properties on the window object using the JavaScriptCore API. You can get the window object of frame from the JavaScript execution context of world that is returned by WebKit2WebExtension.Frame.get_js_context_for_script_world().

New in version 2.2.