Trait webkit2gtk_webextension::prelude::FrameExt
source · [−]pub trait FrameExt: 'static {
fn id(&self) -> u64;
fn js_context(&self) -> Option<Context>;
fn js_context_for_script_world(
&self,
world: &impl IsA<ScriptWorld>
) -> Option<Context>;
fn js_value_for_dom_object(
&self,
dom_object: &impl IsA<DOMObject>
) -> Option<Value>;
fn js_value_for_dom_object_in_script_world(
&self,
dom_object: &impl IsA<DOMObject>,
world: &impl IsA<ScriptWorld>
) -> Option<Value>;
fn uri(&self) -> Option<GString>;
fn is_main_frame(&self) -> bool;
}
Available on crate feature
v2_26
only.Expand description
Required Methods
sourcefn js_context(&self) -> Option<Context>
fn js_context(&self) -> Option<Context>
Get the JavaScript execution context of self
. Use this function to bridge
between the WebKit and JavaScriptCore APIs.
Returns
the javascriptcore::Context
for the JavaScript execution context of self
.
sourcefn js_context_for_script_world(
&self,
world: &impl IsA<ScriptWorld>
) -> Option<Context>
fn js_context_for_script_world(
&self,
world: &impl IsA<ScriptWorld>
) -> Option<Context>
Get the JavaScript execution context of self
for the given ScriptWorld
.
world
Returns
the javascriptcore::Context
for the JavaScript execution context of self
for world
.
sourcefn js_value_for_dom_object(
&self,
dom_object: &impl IsA<DOMObject>
) -> Option<Value>
fn js_value_for_dom_object(
&self,
dom_object: &impl IsA<DOMObject>
) -> Option<Value>
Get a javascriptcore::Value
referencing the given DOM object. The value is created in the JavaScript execution
context of self
.
dom_object
Returns
the javascriptcore::Value
referencing dom_object
.
sourcefn js_value_for_dom_object_in_script_world(
&self,
dom_object: &impl IsA<DOMObject>,
world: &impl IsA<ScriptWorld>
) -> Option<Value>
fn js_value_for_dom_object_in_script_world(
&self,
dom_object: &impl IsA<DOMObject>,
world: &impl IsA<ScriptWorld>
) -> Option<Value>
Get a javascriptcore::Value
referencing the given DOM object. The value is created in the JavaScript execution
context of self
for the given ScriptWorld
.
dom_object
world
Returns
the javascriptcore::Value
referencing dom_object