WebKit2WebExtension.ScriptWorld¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the JavaScript window object in a |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class WebKit2WebExtension.ScriptWorld(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod get_default()¶
- Returns:
the default
WebKit2WebExtension.ScriptWorld
- Return type:
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 aWebKit2WebExtension.ScriptWorld
for a givenWebKit2WebExtension.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:
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. TheWebKit2WebExtension.ScriptWorld
is created with a generated unique name. UseWebKit2WebExtension.ScriptWorld.new_with_name
() if you want to create it with a custom name. You can get the JavaScript execution context of aWebKit2WebExtension.ScriptWorld
for a givenWebKit2WebExtension.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:
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 aWebKit2WebExtension.ScriptWorld
for a givenWebKit2WebExtension.Frame
with webkit_frame_get_javascript_context_for_script_world().New in version 2.22.
- get_name()¶
- Returns:
the name of self
- Return type:
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:
- Parameters:
script_world (
WebKit2WebExtension.ScriptWorld
) – The object which received the signalpage (
WebKit2WebExtension.WebPage
) – aWebKit2WebExtension.WebPage
frame (
WebKit2WebExtension.Frame
) – theWebKit2WebExtension.Frame
to which world belongs
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 byWebKit2WebExtension.Frame.get_js_context_for_script_world
().New in version 2.2.